Re: NSToolbar Design
Re: NSToolbar Design
- Subject: Re: NSToolbar Design
- From: Andreas Schwarz <email@hidden>
- Date: Wed, 6 Mar 2002 19:03:37 -0800
I wanted to get NSToolbar to accept drops in one of my apps
(gBrowser)... What I eventually ended up doing is creating an NSToolbar
category to give me access to the private "_toolbarView" view, and to
that view I added a subview of my own of the exact same size. My
subview handles dragging and dropping (and display during d&d, by
darkening the toolbar a bit) and it seems to work perfectly.
It's not something I'm too happy to have had to do though. For one,
I've heard overlapping views aren't handled too well; however, I made
sure to add mine below everything else (with "addSubview:myView
positioned:NSWindowBelow relativeTo:nil") and it hasn't caused trouble
yet. For another, it may break in the future. But it's the best
solution I could come up with (I did briefly considered the same idea
Eric Peyton mentioned, but I think it seems a bit clunky to the user).
Andreas Schwarz
http://homepage.mac.com/schwarz/
I am curious to know why Apple did not implement NSToolbar and
NSToolbarItem as subclasses of NSView...[snip]
So, why is NSToolbar implemented as a direct descendent of NSObject, and
is there a workaround to specialize the event handling and appearance of
toolbars?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.