The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Re: OSX menus
Christian Walther
Guest

Chris Ball wrote:
Quote:
I've been going a little nuts trying to put the original menus back in to my
carbon osX app. How is this done? When I enable SDL_USE_NIB_FILE and
supply a .nib, I get an error saying: Unable to load nib file: main, exiting.

Works here. I'm not sure if it's supposed to work with any old nib, if
that's what you mean by *a* nib, but it works with *the* SDLMain.nib.

Quote:
There's also no response to cmd-Q, shouldn't that be handled by the cocoa
framework? It looks as though the input events are intercepted prior to
reaching cocoa's handlers.

That's true (for key events). Looking at the source (QZ_DoKey() in
SDL_QuartzEvents.m), is seems that you can change that by setting the
SDL_ENABLEAPPEVENTS environment variable. The other solution is handling
the cmd-Q press "manually" in your SDL event loop.

Quote:
How do I receive the menu events?

The usual way: add a -(IBAction)blah:(id)sender method to the SDLMain
class, re-read its header file in Interface Builder, and make a
target/action connection from the menu item to that method of the
SDLMain object in the nib.

If you need more detailed instructions, just ask, but I think there's no
way around learning a bit about Cocoa for what you're trying to do. (Or
maybe use SDL's Carbon backend, but I don't know anything about that.)

-Christian
Re: OSX menus
Chris Ball
Guest

Found it! (SDLMain.nib, etc.)

Looks like I downloaded the non-devel package.
Razz
Good thing there's no such thing as a stupid question or I'd be in trouble.

Thanks again
Chris
Re: OSX menus
Chris Ball
Guest

OK, I've tried everything and I still can't get past the runtime error:

[784] Unable to load nib file: main, exiting

I have a main.nib and the SDLMain.nib in there. How can it fail to find them?
This problem is absurd but I'm truly stuck.
Re: OSX menus
Christian Walther
Guest

Chris Ball wrote:
Quote:
OK, I've tried everything and I still can't get past the runtime error:

[784] Unable to load nib file: main, exiting

I have a main.nib and the SDLMain.nib in there. How can it fail to find them?
This problem is absurd but I'm truly stuck.

Sounds like you have your main.nib set as the "Main Nib File" in the
"Properties" tab of the target info window, is that so? Try changing
that setting to "SDLMain".

(That's assuming you're using Xcode. If not, edit your info.plist.)

-Christian
Re: OSX menus
Chris Ball
Guest

After re-creating the project, everything started to function correctly.
I was advised to try this by an associate, this is certainly a projectbuilder
bug.

I'm now in the clear 100% (if that doesn't jinx me nothing will).

Thanks Christian and everyone for your patience and advice.

Chris