• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to intercept NSToolbar item selection changes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to intercept NSToolbar item selection changes


  • Subject: Re: How to intercept NSToolbar item selection changes
  • From: Stuart Malin <email@hidden>
  • Date: Mon, 9 Mar 2009 06:38:33 -1000


On Mar 9, 2009, at 3:46 AM, email@hidden wrote:

On Sun, Mar 8, 2009 at 6:03 PM, Stuart Malin <email@hidden> wrote:
I'm building a Preferences window that has a toolbar, in the style of Mail.
I need to know if the user clicks on a toolbar item to change the pane. If
the current pane has pending changes, I display a sheet asking for action
regarding the present changes. I need to do this BEFORE the selected toolbar
item is changed. Which means I need to intercept that change. Alas, I
haven't been able to zero in on how to do that. I don't see NSToolBar
delegate methods that provide such intercept (e.g.
-(BOOL)shouldChangeToolbarItem.... or something of the like), nor do I see
anything useful that I could override if I subclass the Toolbar instance.
So, I must be overlooking something. If anyone can tell me what, I'd be
eternally grateful :-) Â TIA.

Could you simply reset the toolbar selection to whatever it was before, then display your sheet and then manually set the selection to the new one if the user agrees?

I could do that, but then the user would see the selected toolbar item change away, then back. Mail's preference doesn't behave that way, so I am presuming there must be some way to intercept the change and stop it, if appropriate. Perhaps the way do handle this is to prevent redisplay of the window... I'll have to explore this...


_______________________________________________

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


  • Follow-Ups:
    • Re: How to intercept NSToolbar item selection changes
      • From: Michael Ash <email@hidden>
  • Prev by Date: Re: How do I debug iPhone restarts?
  • Next by Date: Re: How to intercept NSToolbar item selection changes
  • Previous by thread: Re: How to intercept NSToolbar item selection changes
  • Next by thread: Re: How to intercept NSToolbar item selection changes
  • Index(es):
    • Date
    • Thread