Creating menu's at runtime
Creating menu's at runtime
- Subject: Creating menu's at runtime
- From: Flemming Bengtsson <email@hidden>
- Date: Mon, 10 Feb 2003 14:40:25 +0100
Hi all,
I'm creating a menu with sub menus at runtime. For some reason I'm not
able to select a submenu item, no checkmark is showing.
records = [gDatabase doSQLStatement:inSQL withInputVars:nil];
enumerator = [records objectEnumerator];
while (fields = [enumerator nextObject])
{
//Add menuitem
[inPop addItemWithTitle: [fields objectAtIndex:0]];
//Build submenu
inputArray = [[NSMutableArray alloc] init];
[inputArray addObject: [fields objectAtIndex:0]];
subRecords = [gDatabase doSQLStatement:kSelectArtSQL
withInputVars:inputArray];
[inputArray release];
aSubMenu = [[NSMenu alloc] init];
[aSubMenu initWithTitle:@"Art"];
subEnumerator = [subRecords objectEnumerator];
while (fields = [subEnumerator nextObject])
{
subFieldContents = [fields objectAtIndex:0];
[aSubMenu addItemWithTitle:subFieldContents
action:@selector(setYdelseArt) keyEquivalent:@""]];
}
[[inPop itemAtIndex:index++] setSubmenu:aSubMenu];
[aSubMenu release];
[subRecords release];
}
[records release];
Regards
Flemming Bengtsson, FLB Software-udvikling
http://www.flbsoftwareudvikling.dk/
iChat/AOL: email@hidden
Phone: +45 24 82 24 25
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.