Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cocoa - customize help menu item

Tags:

macos

cocoa

I need to open safari to the help event in my cocoa application. We can customize the help menu item as this.

http://cocoadevcentral.com/articles/000072.php

But I need to open the the browser to this event. Please help me.

Thank you

like image 914
Dilshan Avatar asked Feb 20 '11 18:02

Dilshan


2 Answers

exactly:

- (void)showHelp:(id)sender
{
    NSURL * helpFile = [[NSBundle mainBundle] URLForResource:@"help" withExtension:@"html"];
    [[NSWorkspace sharedWorkspace] openURL:helpFile];
}
like image 52
Kappe Avatar answered Nov 05 '22 00:11

Kappe


Just change the action of that menu item to another one you provide that opens the web browser with -[NSWorkspace openURL:].

like image 7
millenomi Avatar answered Nov 05 '22 00:11

millenomi