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];