FROM : Quincey Morris
DATE : Mon Mar 03 20:12:49 2008
On Mar 3, 2008, at 10:53, Brian Krisler wrote:
> I have discovered that it is now "almost" possible to create
> toolbars from within
> Interface builder, with one big exception. There appears to be no
> way to
> define identifiers for the toolbar items.
>
> Is this a sign of future functionality? I can not find any
> documentation
> on NSToolbar within IB, every document I can find explains how to
> implement
> toolbars from code, using delegates.
>
> After more exploring, I discovered that I could open the XIB file in
> an XML editor,
> and define the identifiers for my items (they were set to GUID's).
> After renaming
> them to understandable values, I was then able to specify their
> selected state
> from within the code, using my identifiers.
>
> There are a few inspector values that I am not sure exactly what
> they do yet, they
> appear to have no direct function.
>
> Has anyone had experience, good or bad, with creating toolbars from
> IB?
I had the same kind of WTF?!? reaction to the IB's toolbars, until I
guessed you're apparently supposed to do the blindingly obvious:
create IBOutlets for each toolbar item you care about in your window
controller class, hook them up in IB, and do whatever (such as
assigning identifiers, or making certain items selectable) in the
window controller's nib-awake-time code, or its toolbar-delegate
methods.
It feels a little hokey using outlets for this, but it works fine.
DATE : Mon Mar 03 20:12:49 2008
On Mar 3, 2008, at 10:53, Brian Krisler wrote:
> I have discovered that it is now "almost" possible to create
> toolbars from within
> Interface builder, with one big exception. There appears to be no
> way to
> define identifiers for the toolbar items.
>
> Is this a sign of future functionality? I can not find any
> documentation
> on NSToolbar within IB, every document I can find explains how to
> implement
> toolbars from code, using delegates.
>
> After more exploring, I discovered that I could open the XIB file in
> an XML editor,
> and define the identifiers for my items (they were set to GUID's).
> After renaming
> them to understandable values, I was then able to specify their
> selected state
> from within the code, using my identifiers.
>
> There are a few inspector values that I am not sure exactly what
> they do yet, they
> appear to have no direct function.
>
> Has anyone had experience, good or bad, with creating toolbars from
> IB?
I had the same kind of WTF?!? reaction to the IB's toolbars, until I
guessed you're apparently supposed to do the blindingly obvious:
create IBOutlets for each toolbar item you care about in your window
controller class, hook them up in IB, and do whatever (such as
assigning identifiers, or making certain items selectable) in the
window controller's nib-awake-time code, or its toolbar-delegate
methods.
It feels a little hokey using outlets for this, but it works fine.
| Related mails | Author | Date |
|---|---|---|
| Brian Krisler | Mar 3, 19:53 | |
| Quincey Morris | Mar 3, 20:12 | |
| I. Savant | Mar 3, 20:26 | |
| Quincey Morris | Mar 3, 20:53 | |
| Brian Krisler | Mar 5, 03:04 | |
| Quincey Morris | Mar 5, 03:23 | |
| Jonathan Hess | Mar 5, 03:27 |






Cocoa mail archive

