Re: Menu items disabled - Loading a ui framework from cocoa app
Re: Menu items disabled - Loading a ui framework from cocoa app
- Subject: Re: Menu items disabled - Loading a ui framework from cocoa app
- From: Joshua Scott Emmons <email@hidden>
- Date: Mon, 30 Jan 2006 13:09:15 -0600
To start, the priority of the message you sent to the list was
"urgent". That's annoying. Please don't do that.
In a C function i am loading this nib by passing a window
controller object as a Files Owner.
I am calling this function from my Cocoa application. The window is
shown and all events works fine except the main menu bar items.
Menu items like Quit & About are disabled.
Menu items are disabled when they are either not connected to an
action, or that action isn't handled by anything in the current
responder chain. By default (that is, if you create a Cocoa
Application with XCode's New Project Assistant), About Application
and Quit Application are wired to the -orderFrontStandardAboutPanel:
and -terminate: methods of the File's Owner. You say you are passing
your window controller in as the file's owner. Does your window
controller handle these methods? Until it does, those menu items will
remain inactive.
By default these menu items are handled by NSApplication, so you
could always just call NSApp's implementations of the above methods
from your window controller. Though a better solution would be to
keep NSApplication as the File's Owner, just like it is by default. I
don't understand what it is your program is doing, but in general it
is a good idea to stay as close to the default project as is
possible. XCode's pretty smart about setting that stuff up.
Cheers,
-Joshua Emmons
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden