mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 16:05:44 -07:00
Added a dock menu which makes it more convenient to launch a new
game window. [originally from svn r5184]
This commit is contained in:
23
osx.m
23
osx.m
@ -10,11 +10,6 @@
|
|||||||
* think help is HTML round here anyway so perhaps we can work
|
* think help is HTML round here anyway so perhaps we can work
|
||||||
* with what we already have.
|
* with what we already have.
|
||||||
*
|
*
|
||||||
* - Can we arrange for a pop-up menu from the Dock icon which
|
|
||||||
* launches specific games, perhaps?
|
|
||||||
* + apparently we can; see the NSApplication method
|
|
||||||
* `applicationDockMenu:'. Good good. Do so.
|
|
||||||
*
|
|
||||||
* - Why are the right and bottom edges of the Pattern grid one
|
* - Why are the right and bottom edges of the Pattern grid one
|
||||||
* pixel thinner than they should be?
|
* pixel thinner than they should be?
|
||||||
*
|
*
|
||||||
@ -1105,6 +1100,23 @@ void status_bar(frontend *fe, char *text)
|
|||||||
[win makeKeyAndOrderFront:self];
|
[win makeKeyAndOrderFront:self];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSMenu *)applicationDockMenu:(NSApplication *)sender
|
||||||
|
{
|
||||||
|
NSMenu *menu = newmenu("Dock Menu");
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < gamecount; i++) {
|
||||||
|
id item =
|
||||||
|
initnewitem([DataMenuItem allocWithZone:[NSMenu menuZone]],
|
||||||
|
menu, gamelist[i]->name, "", self,
|
||||||
|
@selector(newGame:));
|
||||||
|
[item setPayload:(void *)gamelist[i]];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return menu;
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
@ -1125,6 +1137,7 @@ int main(int argc, char **argv)
|
|||||||
[NSApp setApplicationIconImage:icon];
|
[NSApp setApplicationIconImage:icon];
|
||||||
|
|
||||||
controller = [[[AppController alloc] init] autorelease];
|
controller = [[[AppController alloc] init] autorelease];
|
||||||
|
[NSApp setDelegate:controller];
|
||||||
|
|
||||||
[NSApp setMainMenu: newmenu("Main Menu")];
|
[NSApp setMainMenu: newmenu("Main Menu")];
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user