Re: NSToolbar delegate -toolbarAllowedItemIdentifiers:
Re: NSToolbar delegate -toolbarAllowedItemIdentifiers:
- Subject: Re: NSToolbar delegate -toolbarAllowedItemIdentifiers:
- From: Markus Spoettl <email@hidden>
- Date: Fri, 07 Feb 2014 23:49:46 +0100
On 2/7/14 11:19 PM, Jerry Krinock wrote:
I’ve never used -toolbarAllowedItemIdentifiers:. However, its documentation states…
"Sent to discover the allowed item identifiers for a toolbar.”
Wonderful :)) There is no indication of who sends it, when, nor what is done with the result. The “Discussion” is no more enlightening either. Therefore I have no idea what the purpose of this method is. Apparently, based on your results, its purpose is not your purpose.
On 2014 Feb 07, at 13:43, Markus Spoettl <email@hidden> wrote:
So the question is: How do I remove an item with a given identifier in such a way that it does not appear
Here is how I remove toolbar items that are present in nibs…
NSInteger someToolbarItemIndex = [[toolbar items] indexOfObject:someToolbarItem] ;
if ((someToolbarItemIndex >= 0 ) && (someToolbarItemIndex < [[toolbar items] count]))
{
[toolbar removeItemAtIndex:settingsToolbarItemIndex] ;
}
where ‘toolbar’ and ‘someToolbarItem’ are outlets, connected in the nib. So a disadvantage of my method is that you need an outlet for any removable toolbar item. But I have only have one, and it works for me.
in the customization, neither is single item nor as part of the default toolbar configuration.
I hope that clause was not important because I don’t understand it.
It is important, I'm afraid. Removing the items from the toolbar is not a
problem. However, I can't get the toolbar to remove them from the customization
sheet.
I thought the whole point of telling the toolbar which of the items are allowed
is that those items will not be shown them during customization (or anywhere
else). The -toolbarAllowedItemIdentifiers: delegate method is called at the
beginning of the customization (before the sheet comes up), that's a hint that
it's used for a purpose that has to do with customization. But apparently its
result is ignored because items that are disallowed (by not returning them in
this delegate method) are still visible.
Regards
Markus
--
__________________________________________
Markus Spoettl
_______________________________________________
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