Re: NSToolbar and .toolbar files.
Re: NSToolbar and .toolbar files.
- Subject: Re: NSToolbar and .toolbar files.
- From: Greg Titus <email@hidden>
- Date: Fri, 28 Sep 2001 10:20:54 -0700
On Friday, September 28, 2001, at 09:49 AM, Chris Boot wrote:
Hi,
I've noticed several applications (Address Book, OmniWeb) which use
.toolbar
files in their resources to define the behavior of toolbars. Is there
any
way of easily using such files, or do I have to reinvent the wheel?
I've
looked through the AppKit and OmniAppKit, but can't find any
information in
either of those.
Nope. At least in our case (Omni apps) we are just writing some code in
each app to load the .toolbar dictionary and then set the toolbar up in
the toolbar delegate methods:
-toolbarDefaultItemIdentifiers:
(return the array from the .toolbar plist)
-toolbarAllowedItemIdentifiers:
(return the array from the .toolbar plist)
-toolbar:itemForItemIdentifier:willBeInsertedIntoToolbar:
(set the label, paletteLabel, toolTip, target and action from the
.toolbar plist)
The code is just as simple as you'd expect it to be.
It would be nice to add some sort of generic toolbar controller class to
OmniAppKit, but that hasn't happened yet.
Hope this helps,
--Greg