PDA

View Full Version : NSMenu Woes


King Kovifor
2008-01-08, 16:13
Within my application, Tune-A-Holic, up until now I have been using it only to retrieve the information from iTunes and display it. The only function I have used is updateData: which was called within an NSDistributedNotifications call. My menu problems lie within expanding the application to have the ability to control iTunes from the menu.

My first problem lies within separation. I would like to separate any control items and non-information items from the information that is displayed at the beginning of the drop down. The look I want can be found within the Apple menu between Mac OS X Software and System Preferences. I have found no reference to a function to do this within NSMenu.

My second problem lies within the fact that I want to control iTunes. It is another adventure within Scripting Bridge that I want to mess with. Here is the problem I am having:

sOne = [subMenu addItemWithTitle:@"Item" action:nil keyEquivalent:@""];

I can't figure out how to use the action: part of this line. The NSMenu class reference mentions that this must be a selector, so I used @selector() but that doesn't seem to work.

Any help on either issue would be greatly appreciated.

King Kovifor
2008-01-10, 17:26
I figured out action:. If you want to see the program PM me and I will send you. It requires Leopard.