Re: Some Cocoa Objective-C problems - please help
Re: Some Cocoa Objective-C problems - please help
- Subject: Re: Some Cocoa Objective-C problems - please help
- From: j o a r <email@hidden>
- Date: Thu, 26 Jun 2003 08:17:28 -0700
On Thursday, Jun 26, 2003, at 07:53 US/Pacific, Poornima Ranganath
wrote:
1]with Toolbar.
I have toolbar with 6 items in it of which two are
disabled/enabled on some condition. I need to query
ONLY these two toolbar items for their state [If the
item is Enabled or Disabled] on click of a Button. How
do i query only these two toolbar items on click of a
button?. I know of the method - toolbarItem
"isEnabled".But how do i get a pointers to only these
two items and query them "isEnabled" on click of a
button.?
You should not have to do this. Think about the MVC design pattern,
your view (the toolbar) should only reflect what you already know from
the model layer of your application, ie. you should know the state of
the toolbar without having to look at the toolbar item.
That said, as you point out, there is no
"toolbarItemForToolbarItemIdentifier:" method in NSToolbar, but you can
make one yourself fairly easily if you iterate over the items returned
via the "items" method.
j o a r
_______________________________________________
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.