Re: NSSearchField search template through IB
Re: NSSearchField search template through IB
- Subject: Re: NSSearchField search template through IB
- From: "Louis C. Sacha" <email@hidden>
- Date: Mon, 23 Feb 2004 15:08:54 -0800
Hello...
Disclaimer: I'm not currently targeting 10.3, so I haven't messed
around with NSSearchField (or NSMenu delegates, for that matter), but
maybe this will help.
Have you tried changing the autoEnablesItems setting in the NSMenu
you make in IB (you can change it in the Attributes pane in the
inspector for a NSMenu, in addition to the runtime method)? While it
is usually on by default, perhaps NSSearchField requires that it be
off (and does so automatically when you add a menu as a search
template by calling the setSearchMenuTemplate: method).
Also, have you tried connecting the delegate outlet of the menu to
the NSSearchField cell?
Hope that helps,
Louis
On 23.02.2004, at 20:14, Francisco Tolmasky wrote:
What are the details of setting the search template menu through IB?
Every time I set it, all my options are disabled for some reason.
Regardless of whether they have preset tags or are just custom items
(to implement Mail-like limitations). Is there anything I'm forgetting
to do. Also, when I set the tags in IB, do I have to just set the
equivilant number (for example 1000 instead of
NSSearchFieldRecentsTitleMenuItemTag) or is there a way to write that
out in IB?
I have fiddled around with that a lot - the solution I came up with to
still have the convenience of menu building in IB is:
- (void) initMagic {
// have to do this - item enabling goes bonkers when using the
searchMenuTemplate outlet
[[magicField cell] setSearchMenuTemplate: [magicMenu copy]]; //
leak some memory
}
And yes, I think you have to use tag numbers in IB (which is not
beautiful, I admit)
I don't know WHY this works and I'd be happy if someone could shed
some light on it.
Regards, Bjoern
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.