Re: NSToolbar: notification of change?
Re: NSToolbar: notification of change?
- Subject: Re: NSToolbar: notification of change?
- From: Keary Suska <email@hidden>
- Date: Mon, 1 Jun 2009 17:40:01 -0600
On Jun 1, 2009, at 4:53 PM, David Reitter wrote:
Having subclassed NSToolbar, I am now trying to get a notification
of changes done by the user using the customization palette.
This works fine for the removal of items (toolbarDidRemoveItem:),
but I can't see a way to get notified of added/moved items after the
fact.
The only notification I can get is toolbarWillAddItem:, but that's
obviously before the addition, which is not very helpful.
I have tried implementing insertItemWithItemIdentifier: and also
setConfigurationFromDictionary:, but it seems that the palette
doesn't go through these.
Short of regularly monitoring the tool bar for possible changes, I
don't know what to do...
There is no built-in way to do what you want that I know of. There may
be third-party subclasses or substitutes, but none that I recall.
You can know when the customization palette is invoked, so all you
need to check for is when it is closed and then check for changes. You
could take a snapshot at -runCustomizationPalette:, then set a timer
that checks -customizationPaletteIsRunning until it returns NO, at
which time you check for changes. You are still polling, but at least
it is relatively lightweight.
HTH,
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
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