FROM : Christian Corsano
DATE : Sun May 25 19:31:32 2008
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
DATE : Sun May 25 19:31:32 2008
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
| Related mails | Author | Date |
|---|---|---|
| Christian Corsano | May 25, 11:56 | |
| Jens Alfke | May 25, 18:45 | |
| Nathan Kinsinger | May 25, 18:53 | |
| Christian Corsano | May 25, 19:31 |






Cocoa mail archive

