Launch editor menu item in Mac app

This commit is contained in:
Thomas Denney 2016-09-15 09:23:48 +01:00
parent 18caf554e9
commit 205b94afe8

View File

@ -114,10 +114,17 @@
microBitCount.enabled = NO; microBitCount.enabled = NO;
[menu addItem:microBitCount]; [menu addItem:microBitCount];
NSMenuItem * websiteItem = [[NSMenuItem alloc] initWithTitle:@"Editor" action:@selector(launchEditor:) keyEquivalent:@"e"];
[menu addItem:websiteItem];
NSMenuItem * quitItem = [[NSMenuItem alloc] initWithTitle:@"Quit" action:@selector(terminate:) keyEquivalent:@"q"]; NSMenuItem * quitItem = [[NSMenuItem alloc] initWithTitle:@"Quit" action:@selector(terminate:) keyEquivalent:@"q"];
[menu addItem:quitItem]; [menu addItem:quitItem];
self.menubarItem.menu = menu; self.menubarItem.menu = menu;
} }
- (void)launchEditor:(id)sender {
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"https://codethemicrobit.com/"]];
}
@end @end