Incrementally implementing NSToolbar/NSToolbarItem

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@15318 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
gcasa 2002-12-22 16:14:00 +00:00
parent 0ee4fde3bb
commit 6cbda77075
2 changed files with 18 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2002-12-22 Gregory John Casamento <greg_casamento@yahoo.com>
* Source/NSToolbar.m: Added some of the code needed to add/remove
toolbar items.
2002-12-10 Adam Fedor <fedor@gnu.org> 2002-12-10 Adam Fedor <fedor@gnu.org>
* Source/NSView.m ([NSView -lockFocusInRect:]): Check for window iff * Source/NSView.m ([NSView -lockFocusInRect:]): Check for window iff

View file

@ -204,8 +204,14 @@ static const int current_version = 1;
- (void) insertItemWithItemIdentifier: (NSString *)itemIdentifier - (void) insertItemWithItemIdentifier: (NSString *)itemIdentifier
atIndex: (int)index atIndex: (int)index
{ {
NSToolbarItem *item = [_delegate toolbar: self
itemForItemIdentifier: itemIdentifier
willBeInsertedIntoToolbar: YES];
[nc postNotificationName: NSToolbarWillAddItemNotification
object: self];
[_items insertObject: item atIndex: index];
} }
- (BOOL) isVisible - (BOOL) isVisible
@ -220,6 +226,12 @@ static const int current_version = 1;
- (void) removeItemAtIndex: (int)index - (void) removeItemAtIndex: (int)index
{ {
id obj = [_items objectAtIndex: index];
[_items removeObjectAtIndex: index];
[_visibleItems removeObject: obj];
[nc postNotificationName: NSToolbarDidRemoveItemNotification
object: self];
} }
- (void) runCustomizationPalette: (id)sender - (void) runCustomizationPalette: (id)sender