diff options
author | mfuhrer <mfuhrer> | 2007-07-25 05:39:18 (GMT) |
---|---|---|
committer | mfuhrer <mfuhrer> | 2007-07-25 05:39:18 (GMT) |
commit | b68bccc911dd7b94c0e0af89820e9d986f121356 (patch) | |
tree | f83b9a5ab586732ba983eab667e4db88fbbcc5ee /macosx | |
parent | c8b7f4236ae43e838eb46ea1d8fd41c5e1003d42 (diff) |
Print configuration is now saved between Tux Paint sessions on Mac OS X.
Diffstat (limited to 'macosx')
-rwxr-xr-x | macosx/SDLMain.h | 3 | ||||
-rw-r--r-- | macosx/SDLMain.m | 13 |
2 files changed, 14 insertions, 2 deletions
diff --git a/macosx/SDLMain.h b/macosx/SDLMain.h index f2aea9f..28cd53e 100755 --- a/macosx/SDLMain.h +++ b/macosx/SDLMain.h @@ -3,7 +3,7 @@ Non-NIB-Code & other changes: Max Horn <max@quendi.de> Feel free to customize this file to suit your needs - $Id: SDLMain.h,v 1.3 2007/06/12 05:29:50 mfuhrer Exp $ + $Id: SDLMain.h,v 1.4 2007/07/25 05:39:43 mfuhrer Exp $ */ //#define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_X_VERSION_10_2 @@ -26,6 +26,7 @@ - (IBAction)onQuit:(id)sender; - (void) sendSDLControlKeystroke:(int)key; +- (void) sendSDLControlShiftKeystroke:(int)key; - (void) setupBridge; @end diff --git a/macosx/SDLMain.m b/macosx/SDLMain.m index 358ac44..8354fe2 100644 --- a/macosx/SDLMain.m +++ b/macosx/SDLMain.m @@ -183,7 +183,7 @@ static NSString *getApplicationName(void) - (IBAction) onPageSetup:(id)sender { - DisplayPageSetup(); + [self sendSDLControlShiftKeystroke:SDLK_p]; } - (IBAction) onUndo:(id)sender @@ -204,6 +204,8 @@ static NSString *getApplicationName(void) - (IBAction) onQuit:(id)sender { + [[NSUserDefaults standardUserDefaults] synchronize]; + /* Post a SDL_QUIT event */ SDL_Event event; event.type = SDL_QUIT; @@ -219,6 +221,15 @@ static NSString *getApplicationName(void) SDL_PushEvent(&event); } +- (void) sendSDLControlShiftKeystroke:(int)key +{ + SDL_Event event; + event.type = SDL_KEYDOWN; + event.key.keysym.sym = key; + event.key.keysym.mod = KMOD_CTRL | KMOD_SHIFT; + SDL_PushEvent(&event); +} + /* Set the working directory to the .app's parent directory */ - (void) setupWorkingDirectory:(BOOL)shouldChdir { |