NSPopUpButton in toolbar ignoring setEnable: on Leopard
NSPopUpButton in toolbar ignoring setEnable: on Leopard
- Subject: NSPopUpButton in toolbar ignoring setEnable: on Leopard
- From: Richard Pollock <email@hidden>
- Date: Fri, 25 Jan 2008 01:05:47 +0000
My app has an NSPopUpButton and an NSSearchField in the toolbar, which
(I think) are misbehaving...
On Tiger, the controls were each placed in their own custom view in
their disabled state (by unchecking "Enabled" in IB) and added to the
toolbar by my NSDocument subclass in -
toolbar:itemForItemIdentifier:willBeInsertedIntoToolbar:. The controls
were enabled later by calling [myNSControl setEnabled:TRUE]. This
worked fine on Tiger.
After moving to Leopard, these controls stopped activating when -
setEnabled:TRUE was called. As a temporary fix, I just enabled them
permanently in IB, but today I took the liberty of removing all my
NSToolbar delegate methods and rebuilding the toolbar in IB (I'm going
Leopard-only). This has been successful except for the problem of
activating my NSPopUpButton and NSSearchField at run time, which I
just can't seem to achieve.
I added the controls directly to the toolbar from the palette in IB,
connected the appropriate outlets and actions, which has worked - the
NSPopUpButton menu populates correctly, but remains inactive. I've
also tried to call -setEnabled:TRUE on the NSToolbarItem containing
the the NSPopUpButton followed by -setEnabled:TRUE on the
NSPopUpButton itself, but all to no avail. Finally, I've set my
NSDocument subclass up as the delegate again and implemented -
validateToolbarItem: to return TRUE regardless of the item...
So basically, my question is: am I doing anything wrong here? The
toolbar programming guide says "If the view is an NSControl you can
call setEnabled:, which will in turn call setEnabled:on the control",
so I don't know why it's not working in my hands... Any pointers (no
pun intended) would be most appreciated!
Cheers,
Rich
_______________________________________________
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