Login  •  Register


The time is now: Thu Sep 20, 2018 2:38 pm

Emaculation wiki  •  Delete all board cookies



Post new topic  Reply to topic Page 1 of 1 [ 13 posts ]
Print view Previous topic  |  Next topic
Author Message
PostPosted: Mon Jun 18, 2018 12:51 pm 
Offline
Forum All-Star

Joined: Tue Oct 14, 2008 12:12 am
Posts: 899
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"...


Last edited by emendelson on Mon Jun 18, 2018 9:04 pm, edited 1 time in total.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Mon Jun 18, 2018 6:21 pm 
Offline
Forum All-Star
User avatar

Joined: Fri Nov 27, 2009 5:11 am
Posts: 2194
Location: Emaculation.com
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.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Mon Jun 18, 2018 9:03 pm 
Offline
Forum All-Star

Joined: Tue Oct 14, 2008 12:12 am
Posts: 899
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 :)


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.

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...


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Mon Jun 18, 2018 10:09 pm 
Offline
Forum All-Star
User avatar

Joined: Fri Nov 27, 2009 5:11 am
Posts: 2194
Location: Emaculation.com
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.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Jun 20, 2018 2:12 pm 
Offline
Tinkerer

Joined: Thu Nov 09, 2017 12:06 pm
Posts: 50
A sample code is here.

https://github.com/kanjitalk755/macemu/blob/master/SheepShaver/src/MacOSX/prefs_macosx.mm

See prefs_init() function.
In case SDL1, appending preferences menu.
In case SDL2, modifying preferences menu appended by SDL_Init().


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Thu Jun 21, 2018 1:54 am 
Offline
Forum All-Star

Joined: Tue Oct 14, 2008 12:12 am
Posts: 899
Thank you! I will certainly try it.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Fri Jun 22, 2018 1:48 am 
Offline
Forum All-Star

Joined: Tue Oct 14, 2008 12:12 am
Posts: 899
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.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Sun Jun 24, 2018 5:11 am 
Offline
Tinkerer

Joined: Thu Nov 09, 2017 12:06 pm
Posts: 50
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


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Sun Jun 24, 2018 12:01 pm 
Offline
Forum All-Star

Joined: Tue Oct 14, 2008 12:12 am
Posts: 899
Thank you! That was exactly what I was looking for. I'll report results when I have any...


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Sun Jun 24, 2018 7:09 pm 
Offline
Forum All-Star

Joined: Tue Oct 14, 2008 12:12 am
Posts: 899
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.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Jun 27, 2018 1:29 am 
Offline
Forum All-Star

Joined: Tue Oct 14, 2008 12:12 am
Posts: 899
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:

Image

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.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Jun 27, 2018 10:31 am 
Offline
Tinkerer

Joined: Thu Nov 09, 2017 12:06 pm
Posts: 50
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.

In "Build Phases" of SheepShaver target:
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?


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Jun 27, 2018 11:59 am 
Offline
Forum All-Star

Joined: Tue Oct 14, 2008 12:12 am
Posts: 899
kanjitalk755 wrote:
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.

In "Build Phases" of SheepShaver target:
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?


Works perfectly! Thank you!


Top
 Profile  
Reply with quote Post a reply  
Display posts from previous:  Sort by  
Post new topic  Reply to topic Page 1 of 1 [ 13 posts ]


Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot] and 19 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
 

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group