NSToolbarItem in NSToolbar twice - why?
NSToolbarItem in NSToolbar twice - why?
- Subject: NSToolbarItem in NSToolbar twice - why?
- From: David Haas <email@hidden>
- Date: Sun, 11 Aug 2002 22:17:51 -0500
Hi. I've got a problem with my NSTextView in an NSToolbarItem
again, and I'm hoping someone can help me out.
I've got an NSToolbarItem for which the view is a custom view containing
an NSTextView. To get the customization palette to work, I've had to
be clever about handling the encoding/decoding of the NSTextView
(basically, I'm removing the NSTextView from the custom view before
encoding, and adding a new NSTextView to the custom view when it
is decoded).
Here's the problem: if I have a copy of my toolbar item containing the
text view present in the toolbar, and I drag another copy of the toolbar
item into the toolbar, the new item gets added, but the old item is still
there. Both items have the same toolbar item identifier. I don't want
the old item to be there. In fact, it can lead to a crash.
The problem is the text view - if I remove it entirely from the custom
view
of the toolbar item, then adding a new copy of the toolbar item
automatically
removes the old item (as it should).
I'm not subclassing NSToolbar or NSToolbarItem, although I have
tried to make a subclass of NSToolbarItem which overrides
allowsDuplicatesInToolbar
to always return NO, and I didn't see any change in behavior.
Can anyone tell me either why the toolbar is letting me add 2 items with
the same identifier, or why the NSTextView causes these problems, or
even better how I can prevent this from happening?
Thanks in advance . . .
_______________________________________________
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.