Create help menu under SDL2?
Moderators: Cat_7, Ronald P. Regensburg, ClockWise
-
- Forum All-Star
- Posts: 1726
- Joined: Tue Oct 14, 2008 12:12 am
Create help menu under SDL2?
For my SheepShaver projects, I've managed to build a custom top-line Help menu under SDL 1.2, using the syntax in the version of SDLMain.m linked below (my additions have "emendelson" in the comments). In order to use the Help menu, there also needs to be a Help folder in SheepShaver's resources, and references to it in SheepShaver's info.plist. It's a kludge, but it works.
http://www.columbia.edu/~em36/SDLMain.m
SheepShaver for SDL2 doesn't use SDLMain.m and I haven't been able to find out whether this kind of thing is possible at all under SDL2. I'm not sure anyone ever used the Help menus that I put together, but it was an interesting challenge to make them work, and I'd like to figure out to do it under SDL2. Is there any expert here who might be able to point to sample code that gets the job done? Many thanks for any help.
EDIT: Somehow, autocorrect changed "out" to "outlaw"...
http://www.columbia.edu/~em36/SDLMain.m
SheepShaver for SDL2 doesn't use SDLMain.m and I haven't been able to find out whether this kind of thing is possible at all under SDL2. I'm not sure anyone ever used the Help menus that I put together, but it was an interesting challenge to make them work, and I'd like to figure out to do it under SDL2. Is there any expert here who might be able to point to sample code that gets the job done? Many thanks for any help.
EDIT: Somehow, autocorrect changed "out" to "outlaw"...
Last edited by emendelson on Mon Jun 18, 2018 9:04 pm, edited 1 time in total.
- adespoton
- Forum All-Star
- Posts: 4284
- Joined: Fri Nov 27, 2009 5:11 am
- Location: Emaculation.com
- Contact:
Re: Create help menu under SDL2?
I used the help menus... I stuck some stuff in the help folder detailing the history of the OS emulated. It's nice to have that cleanly exposed
Unfortunately, I haven't really dug into SDL2 to that level, so I'm unsure of how to duplicate this.
Unfortunately, I haven't really dug into SDL2 to that level, so I'm unsure of how to duplicate this.
-
- Forum All-Star
- Posts: 1726
- Joined: Tue Oct 14, 2008 12:12 am
Re: Create help menu under SDL2?
Thank you!! It's very good to know that someone actually uses these things. This makes me want to look further into SDL2, but I've had no luck so far.adespoton wrote:I used the help menus... I stuck some stuff in the help folder detailing the history of the OS emulated. It's nice to have that cleanly exposed
And could you spell out exactly what you did to add stuff to the help menu, and whether you were working in the SheepShaver Wrapper or Mac OS 9?? Thanks - this could be useful to other people too...
- adespoton
- Forum All-Star
- Posts: 4284
- Joined: Fri Nov 27, 2009 5:11 am
- Location: Emaculation.com
- Contact:
Re: Create help menu under SDL2?
I can't remember the details offhand other than sticking or updating an RTF file in the help folder; it was in the Wrapper builds.
-
- Apple Corer
- Posts: 239
- Joined: Thu Nov 09, 2017 12:06 pm
Re: Create help menu under SDL2?
A sample code is here.
https://github.com/kanjitalk755/macemu/ ... _macosx.mm
See prefs_init() function.
In case SDL1, appending preferences menu.
In case SDL2, modifying preferences menu appended by SDL_Init().
https://github.com/kanjitalk755/macemu/ ... _macosx.mm
See prefs_init() function.
In case SDL1, appending preferences menu.
In case SDL2, modifying preferences menu appended by SDL_Init().
-
- Forum All-Star
- Posts: 1726
- Joined: Tue Oct 14, 2008 12:12 am
Re: Create help menu under SDL2?
Thank you! I will certainly try it.
-
- Forum All-Star
- Posts: 1726
- Joined: Tue Oct 14, 2008 12:12 am
Re: Create help menu under SDL2?
I'm still working on adding a Help dropdown to the top-line menu. I think it requires working with main_menu.nib, but am not sure. If anyone has any experience with this kind of thing, I'll be glad to know about it.
-
- Apple Corer
- Posts: 239
- Joined: Thu Nov 09, 2017 12:06 pm
Re: Create help menu under SDL2?
SheepShaver project doesn't use NIB file of main menu.
Using SDL2, main menu all is built by code.
The function is CreateApplicationMenus() in following source.
https://github.com/SDL-mirror/SDL/blob/ ... oaevents.m
Using SDL2, main menu all is built by code.
The function is CreateApplicationMenus() in following source.
https://github.com/SDL-mirror/SDL/blob/ ... oaevents.m
-
- Forum All-Star
- Posts: 1726
- Joined: Tue Oct 14, 2008 12:12 am
Re: Create help menu under SDL2?
Thank you! That was exactly what I was looking for. I'll report results when I have any...
-
- Forum All-Star
- Posts: 1726
- Joined: Tue Oct 14, 2008 12:12 am
Re: Create help menu under SDL2?
David Ludwig includes SDL2 as an external resource in his code, and I'm able to build his version by adding SDL source to the External folder in his code. (I can even launch it from the terminal by putting a ROM file in the same folder with the unix executable.)
David Ludwig's build has a menu with the View items (including a tab bar!), and I'm guessing that it might be possible to modify this menu in your build by adding SDL code in the same way that David Ludwig does, and then modifying SDL_cocoaevents.m. But if this is completely wrong, I hope someone will warn me.
David Ludwig's build has a menu with the View items (including a tab bar!), and I'm guessing that it might be possible to modify this menu in your build by adding SDL code in the same way that David Ludwig does, and then modifying SDL_cocoaevents.m. But if this is completely wrong, I hope someone will warn me.
-
- Forum All-Star
- Posts: 1726
- Joined: Tue Oct 14, 2008 12:12 am
Re: Create help menu under SDL2?
Thanks to kanjitalk755 pointing me in the right direction, I've had some success building a Help menu for SheepShaver, modifying kanjitalk755's code. Here's a screen shot:
When you click on Setup Guide, the guide in this forum opens in the browser.
It isn't a complete success, because when I click on SheepShaver Help, I get a window saying the content is not available, though the content is exactly the same (and with the same reference in the info.plist) as in one of my old builds where the Help displays correctly. I hope adespoton can help sort this out, as he's succeeded in putting new content in the help menu earlier.
Also, here's how I modified kanjitalk755's code. I removed the reference to SDL Framework, and added a reference to the SDL Xcode project, as in David Ludwig's code. I still haven't figured out how to make Xcode move the SDL framework (after building it) into the Contents/Frameworks folder in the SheepShaver app, so I did that by hand. Presumably an Xcode expert would know how to do this in seconds.
EDIT: I got the help working, and will post a build soon for anyone who might be interested.
When you click on Setup Guide, the guide in this forum opens in the browser.
It isn't a complete success, because when I click on SheepShaver Help, I get a window saying the content is not available, though the content is exactly the same (and with the same reference in the info.plist) as in one of my old builds where the Help displays correctly. I hope adespoton can help sort this out, as he's succeeded in putting new content in the help menu earlier.
Also, here's how I modified kanjitalk755's code. I removed the reference to SDL Framework, and added a reference to the SDL Xcode project, as in David Ludwig's code. I still haven't figured out how to make Xcode move the SDL framework (after building it) into the Contents/Frameworks folder in the SheepShaver app, so I did that by hand. Presumably an Xcode expert would know how to do this in seconds.
EDIT: I got the help working, and will post a build soon for anyone who might be interested.
Last edited by emendelson on Thu Jun 28, 2018 2:09 am, edited 1 time in total.
-
- Apple Corer
- Posts: 239
- Joined: Thu Nov 09, 2017 12:06 pm
Re: Create help menu under SDL2?
In "Build Phases" of SheepShaver target:emendelson wrote:Also, here's how I modified kanjitalk755's code. I removed the reference to SDL Framework, and added a reference to the SDL Xcode project, as in David Ludwig's code. I still haven't figured out how to make Xcode move the SDL framework (after building it) into the Contents/Frameworks folder in the SheepShaver app, so I did that by hand. Presumably an Xcode expert would know how to do this in seconds.
1) Click "+" button at "Target Dependencies".
2) Specify SheepShaver_Xcode8/SDL/Framework.
3) Click "+" button at "Embed Frameworks".
4) Specify SheepShaver_Xcode8/external/SDL.xcode/Products/SDL2.framework.
How is it?
-
- Forum All-Star
- Posts: 1726
- Joined: Tue Oct 14, 2008 12:12 am
Re: Create help menu under SDL2?
Works perfectly! Thank you!kanjitalk755 wrote:In "Build Phases" of SheepShaver target:emendelson wrote:Also, here's how I modified kanjitalk755's code. I removed the reference to SDL Framework, and added a reference to the SDL Xcode project, as in David Ludwig's code. I still haven't figured out how to make Xcode move the SDL framework (after building it) into the Contents/Frameworks folder in the SheepShaver app, so I did that by hand. Presumably an Xcode expert would know how to do this in seconds.
1) Click "+" button at "Target Dependencies".
2) Specify SheepShaver_Xcode8/SDL/Framework.
3) Click "+" button at "Embed Frameworks".
4) Specify SheepShaver_Xcode8/external/SDL.xcode/Products/SDL2.framework.
How is it?