Add MacOS 10.4 method -selectItemWithTag:.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@26743 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2008-07-02 22:10:53 +00:00
parent 8b43d12ff0
commit 001bdbc4e9
3 changed files with 25 additions and 0 deletions

View file

@ -1,3 +1,9 @@
2008-07-02 Fred Kiefer <FredKiefer@gmx.de>
* Headers/AppKit/NSPopUpButton.h,
* Source/NSPopUpButton.m (-selectItemWithTag:): Add MacOS 10.4
method.
2008-06-17 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSClipView.m (_scrollToPoint:): New method for adjusted

View file

@ -68,6 +68,9 @@
- (void)selectItem:(id <NSMenuItem>)anObject;
- (void)selectItemAtIndex:(int)index;
- (void)selectItemWithTitle:(NSString *)title;
#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
- (BOOL) selectItemWithTag: (NSInteger)tag;
#endif
- (int)numberOfItems;
- (NSArray *)itemArray;
- (id <NSMenuItem>)itemAtIndex:(int)index;

View file

@ -284,6 +284,22 @@ this to return nil to indicate that we have no context menu.
[self synchronizeTitleAndSelectedItem];
}
- (BOOL) selectItemWithTag: (NSInteger)tag
{
int index = [self indexOfItemWithTag: tag];
if (index >= 0)
{
[self selectItemAtIndex: index];
return YES;
}
else
{
return NO;
}
}
/** <p>Returns the number of items in the item list</p>
<p>See Also: [NSPopUpButtonCell-numberOfItems]</p>
*/