File: defaultSelection.m

package info (click to toggle)
gnustep-gui 0.32.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 15,348 kB
  • sloc: objc: 178,763; ansic: 24,089; cpp: 664; yacc: 464; sh: 90; makefile: 72
file content (41 lines) | stat: -rw-r--r-- 781 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
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;

	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

	b=[[NSPopUpButton alloc] init];

	[b addItemWithTitle: @"foo"];
	[b addItemWithTitle: @"bar"];

	pass([b indexOfSelectedItem] == 0,"first item is selected by default");

	END_SET("NSPopupButton GNUstep defaultSelection")

	DESTROY(arp);

	return 0;
}