Skip navigation.
 
mlRe: Problem configuring NSToolbarItem in IB
FROM : Nathan Kinsinger
DATE : Sun May 25 18:53:03 2008

On May 25, 2008, at 3:56 AM, Christian Corsano wrote:

> Hi to you all,
> I've been reading this list for quite a while now, and I need a hand 
> on a small problem :
> I can't find a way to set the identifier of my custom NSToolbarItems 
> in Interface Builder.
>
> I'm building a document based application with a NSToolbar in the 
> document window.
> I've added several custom toolbar items in it, following the 
> procedure described here:
> http://developer.apple.com/documentation/DeveloperTools/Conceptual/IB_UserGuide/BuildingaNibFile/chapter_4_section_4.html#/
> apple_ref/doc/uid/TP40005344-CH11-DontLinkElementID_29
>
> Now my problem is I need to use these items programmatically (to 
> implement a delegate for my NSToolbar), and by looking at the xib 
> file the identifiers for these items are some kind of hash-code, and 
> I can't find a place to set it in IB.
>
> I've considered configuring the toolbar in my code (the old way), 
> but I'd like to avoid it to get a better overview of my design in IB.
>
> I could also subclass NSToolbarItems and override the identifier, 
> but as I have no need for customizing my toolbar items behavior it 
> seems a bit of a overkill.
>
> Any ideas ?
>
> Christian Corsano
> http://www.conceptoire.com
> _________________________________



I have no idea why they don't allow you to set the identifier in IB, 
but you can set the Tag of each item and use that to identify each 
individual toolbar item.

In a preference panel where the toolbar is not customizable I've used 
the paletteLabel as an identifier. But don't do that if it is 
customizable since the labels will change if they are localized.

--Nathan

Related mailsAuthorDate
mlProblem configuring NSToolbarItem in IB Christian Corsano May 25, 11:56
mlRe: Problem configuring NSToolbarItem in IB Jens Alfke May 25, 18:45
mlRe: Problem configuring NSToolbarItem in IB Nathan Kinsinger May 25, 18:53
mlRe: Problem configuring NSToolbarItem in IB Christian Corsano May 25, 19:31