Re: Re: Cannot get toolbar to appear in window
Re: Re: Cannot get toolbar to appear in window
- Subject: Re: Re: Cannot get toolbar to appear in window
- From: Timothy Mowlem <email@hidden>
- Date: Fri, 27 Apr 2007 00:47:26 +0100
Hello,
Okay thanks, just as you suggested the call [NSApp mainWindow] was
returning NULL. Using an outlet in the delegate works fine.
The reason I thought using mainWindow should work is that the Cocoa
class documentation for NSApplication states "Sent by the default
notification center after the application has been launched and
initialized but before it has received its first event.". The
statement is really nebulous as it doesn't give any indication as to
how the state differs (if at all) from the normal running state.
I was aware of the concept of main and key windows. My thinking was
that since there would only be a single window in my case (the window
loaded via the main nib) that using [NSApp mainWindow] should always
return the one window.
Thank you and everyone else for your prompt help.
Regards,
Timothy Mowlem
On 26 Apr 2007, at 19:54, I. Savant wrote:
On 4/26/07, email@hidden <email@hidden> wrote:
So still not sure why it is failing.
You seem to have missed the hints, so I'll spell it out for you:
[NSApp mainWindow] may be returning nil, and if so, you're sending
your -setToolbar: message to nil, which of course does absolutely
nothing.
The easiest thing for you to do is to add an outlet to your app
delegate (say "myWindow" or something like that), connect it to your
window, then: [myWindow setToolbar:...].
--
I.S.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden