Re: Subclassing NSToolBar.
Re: Subclassing NSToolBar.
- Subject: Re: Subclassing NSToolBar.
- From: Dan Wood <email@hidden>
- Date: Fri, 05 Oct 2001 08:15:08 -0700
I for one would love to see Apple release the code to NSToolbar as
sample code (just as they have the source to TextEdit.app) because
even though NSToolbar is quite useful, it appears that *many*
applications (I believe OmniWeb, System Preferences, probably Mail
from your description, and perhaps more) roll their own toolbar.
Ideally, the class should be flexible enough that it can be
extended rather than re-implemented, but if so many clients need to
"roll their own", it would be very helpful (in terms of
implementation details and providing a consistent user experience)
if we could duplicate the pieces that are the same as the base (for
instance, the customization dialog, sliding and dragging behavior,
and so forth.)
-- Dan
On Thursday, October 4, 2001, at 12:12 AM, John C. Randolph wrote:
I'd like to have a custom view that behaves like NSToolBarView, so
that when you drag its items around, you get that nice smooth
animation as things shift to make room for what you're dragging.
I'm trying to get an idea of whether it's quicker to re-implement
or to subclass NSToolBar to do what I want.
First of all, NSToolBarView isn't published API, so I'd have to
snarf it with class-dump. Secondly, when playing around with the
toolbar in Mail, I can see that there are times when there's more
than one icon sliding. Thirdly, I have a need for a vertical
orientation as well as the existing horizontal mode.
For what I have in mind, I won't be needing the configuration
sheet. All of the items in my toolbar would represent instances
of the same class.
Anyone care to share some ideas?
-jcr
"I fear all we have done is to awaken a sleeping giant and fill
him with a terrible resolve." -Admiral Isoroku Yamamoto, Dec 7,
1941.
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
--
Dan Wood
email@hidden
http://www.karelia.com/
http://www.bikealameda.org/
Mac OS X Developer: Online Resume:
http://www.karelia.com/resume.html