2011-02-19 16:57:57 +00:00
|
|
|
/*
|
|
|
|
copyright 2005 Alexander Malmberg <alexander@malmberg.org>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "Testing.h"
|
|
|
|
|
|
|
|
#include <AppKit/NSApplication.h>
|
|
|
|
#include <AppKit/NSPopUpButton.h>
|
|
|
|
|
|
|
|
int main(int argc, char **argv)
|
|
|
|
{
|
|
|
|
CREATE_AUTORELEASE_POOL(arp);
|
|
|
|
NSPopUpButton *b;
|
|
|
|
|
2016-05-13 15:41:27 +00:00
|
|
|
START_SET("NSPopupButton GNUstep defaultSelection")
|
|
|
|
|
|
|
|
NS_DURING
|
|
|
|
{
|
|
|
|
[NSApplication sharedApplication];
|
|
|
|
}
|
|
|
|
NS_HANDLER
|
|
|
|
{
|
|
|
|
if ([[localException name] isEqualToString: NSInternalInconsistencyException ])
|
|
|
|
SKIP("It looks like GNUstep backend is not yet installed")
|
|
|
|
}
|
|
|
|
NS_ENDHANDLER
|
2011-02-19 16:57:57 +00:00
|
|
|
|
|
|
|
b=[[NSPopUpButton alloc] init];
|
|
|
|
|
|
|
|
[b addItemWithTitle: @"foo"];
|
|
|
|
[b addItemWithTitle: @"bar"];
|
|
|
|
|
|
|
|
pass([b indexOfSelectedItem] == 0,"first item is selected by default");
|
|
|
|
|
2016-05-13 15:41:27 +00:00
|
|
|
END_SET("NSPopupButton GNUstep defaultSelection")
|
|
|
|
|
2011-02-19 16:57:57 +00:00
|
|
|
DESTROY(arp);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|