• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Creating menu's at runtime
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: Create a custom control (widget)
  • Next by Date: Splash Screen Strategy?
  • Previous by thread: Re: Removing Entry from Addressbook externally
  • Next by thread: Re: Creating menu's at runtime
  • Index(es):
    • Date
    • Thread