Objective c 右键单击和左键单击菜单栏应用程序
我有这个菜单栏应用程序,它是用来执行一个行动时,它是左键点击,并显示菜单时,它是右键点击。唯一的问题是我不知道怎么做。有人能帮我吗? 这是我用于启用菜单栏应用程序的代码:Objective c 右键单击和左键单击菜单栏应用程序,objective-c,menu,menubar,right-click,Objective C,Menu,Menubar,Right Click,我有这个菜单栏应用程序,它是用来执行一个行动时,它是左键点击,并显示菜单时,它是右键点击。唯一的问题是我不知道怎么做。有人能帮我吗? 这是我用于启用菜单栏应用程序的代码: - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { // Insert code here to initialize your application [_aboutWindow orderOut:nil]; } -
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
// Insert code here to initialize your application
[_aboutWindow orderOut:nil];
}
- (void)awakeFromNib{
statusItem = [[[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength] retain];
NSBundle *bundle = [NSBundle mainBundle];
statusImage = [[NSImage alloc] initWithContentsOfFile:[bundle pathForResource:@"icon" ofType:@"png"]];
statusHighlightImage = [[NSImage alloc] initWithContentsOfFile:[bundle pathForResource:@"hicon" ofType:@"png"]];
[statusItem setImage:statusImage];
[statusItem setAlternateImage:statusHighlightImage];
[statusItem setMenu:statusMenu];
[statusItem setHighlightMode:YES];
}
-(void)dealloc{
[statusImage release];
[super dealloc];
}
欢迎来到SO!如果你说‘我想要这个’,我们很难回答,因为答案太宽泛了。相反,描述一下你目前遇到的问题,或者什么问题不起作用。我问你怎么做,因为我不知道怎么做。