Re: get a window in front by clicking on a menu item
Re: get a window in front by clicking on a menu item
- Subject: Re: get a window in front by clicking on a menu item
- From: Alexander Spohr <email@hidden>
- Date: Fri, 5 Jun 2009 23:20:36 +0200
A nib/xib contains frozen objects. If you load them they are thawed.
You can load a nib multiple times with a new instance of its owner
every time.
Am 05.06.2009 um 21:52 schrieb Martin Batholdy:
If you create your menuHandler in awakeFromNib, how can you connect
it to the window in IB? It not there when you try to connect the
outlet.
You seem to connect to another / a wrong menuHandler instance.
Yeah ... I think that is what is going wrong;
what I know is, that the method (showWindow:) gets called
(did make that sure by adding NSLog-messages) -
but it does not interact with the window.
but ... how would you do the connections to the window properly?
Do I have to connect the window in the IB with the AppController?
But than ... the MenuHandler don't know nothing about the window ...
Then let the AppController tell the MenuHandler after it creates it.
Easy.
And how can I say the menuItem in menuHandler to use an existing
instance of an AppController Object?
(with setTarget: ...) ..
See line above. The AppController knows the MenuHandler and can tell
it what it needs to know.
So I don't really know how you can say a menuItem;
hey, there is an instance of an object that created you, and this
also have connection to an existing window; now go to the openWindow
method when someone clicks on you and get that damn window in front...
(is that the way it should work ..?)
[menuItem setTarget:myWindowOutlet];
[menuItem setAction:@selector(makeKeyAndOrderFront:)];
or something like it.
atze
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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