Setting the action for a menu item
Setting the action for a menu item
- Subject: Setting the action for a menu item
- From: Jeffrey Mattox <email@hidden>
- Date: Mon, 3 Feb 2003 17:19:50 -0600
I am using AppleScript Studio to write my application. Using Cocoa,
however, I create a status bar menu and add several items to it. I
have a loop for making the items that contains this code ("i" is the
loop counter):
theMenuItem = [theMenu insertItemWithTitle:@"Item"
action:0 keyEquivalent:@"" atIndex:i];
1. It works fine (the menu and the items are there), but I don't
know how to connect the "action:" to another routine in my Cocoa
file. How do I do that?
2. The menu items will use the same handler, I just need to pass a
different value for each item. I assume I use the "setTarget:"
and/or "setTag:" methods -- is that correct? If so, does the tag
show up as a parameter on the action handler?
Jeff
_______________________________________________
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.