On 25 mai 08, at 18:45, Jens Alfke wrote:

You should be able to add IBOutlets to your controller and wire them up to the individual toolbar items in IB.

Thanks Jens, I hadn't thought of this solution !
But it still doesn't fell right to have to wire all these instances manually and keep a reference in my controller just to set their identifiers ...

On 25 mai 08, at 18:53, Nathan Kinsinger wrote:

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.

Thanks Nathan, I was wondering how other people dealt with this problem

I have considered this solution, but as I haven't decided yet whether I want to allow toolbar customization I dropped it pretty quickly (and even if I decide not to, using a label as an unique identifier seems too much of a hack in this beautiful Cocoa world).

Here's what I've done for now : removed the items from my toolbar in IB and initialized them in my controller. This way I can avoid hardcoding everything related to the toolbar items, as I load their values from a localized plist file.

But of course I can no longer visualize my toolbar items in IB ... I may eventually switch to Jens' idea


Christian
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to