From fd8ebd6a78e0e71ff5fbb3e558bcf4d118fc8450 Mon Sep 17 00:00:00 2001 From: Fred Kiefer Date: Sun, 6 Sep 2009 21:38:15 +0000 Subject: [PATCH] * Source/NSPopUpButton.m (-selectedTag): Return the tag of the selected item. Patch by Douglas Simons . git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28617 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 6 ++++++ Source/NSPopUpButton.m | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/ChangeLog b/ChangeLog index e6bf18041..499490de6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-09-06 Fred Kiefer + + * Source/NSPopUpButton.m (-selectedTag): Return the tag of the + selected item. + Patch by Douglas Simons . + 2009-09-04 Nicola * Images/GNUmakefile: Rewritten using the standard diff --git a/Source/NSPopUpButton.m b/Source/NSPopUpButton.m index 104b85b80..098c8e084 100644 --- a/Source/NSPopUpButton.m +++ b/Source/NSPopUpButton.m @@ -251,6 +251,14 @@ this to return nil to indicate that we have no context menu. return [_cell indexOfSelectedItem]; } +/**

Returns the tag of the selected item

+

See Also: [NSPopUpButtonCell-indexOfSelectedItem]

+*/ +- (int) selectedTag +{ + return [[_cell selectedItem] tag]; +} + - (void) selectItem: (id )anObject { [self willChangeValueForKey: NSSelectedIndexBinding];