]> granicus.if.org Git - python/commitdiff
Only show the UI for selecting options if the ALT key was depressed while
authorJack Jansen <jack.jansen@cwi.nl>
Thu, 1 Aug 2002 15:07:00 +0000 (15:07 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Thu, 1 Aug 2002 15:07:00 +0000 (15:07 +0000)
dragging or double-clicking the script.

Mac/OSX/PythonLauncher/MyAppDelegate.m

index 107e7d092b6e1675d0b2bad3eb9b68a66c3edcbe..cb9797249db7e5875c9c710852ac7bc56266e819 100644 (file)
@@ -1,5 +1,6 @@
 #import "MyAppDelegate.h"
 #import "PreferencesWindowController.h"
+#import <Carbon/Carbon.h>
 
 @implementation MyAppDelegate
 
 
 - (BOOL)shouldShowUI
 {
-    // if this call comes before applicationDidFinishLaunching: we do not show a UI
-    // for the file. Also, we should terminate immedeately after starting the script.
-    if (initial_action_done)
-        return YES;
+    // if this call comes before applicationDidFinishLaunching: we 
+    // should terminate immedeately after starting the script.
+    if (!initial_action_done)
+        should_terminate = YES;
     initial_action_done = YES;
-    should_terminate = YES;
+    if( GetCurrentKeyModifiers() & optionKey )
+        return YES;
     return NO;
 }
 
     return NO;
 }
 
-
-- (BOOL)application:(NSApplication *)sender xx_openFile:(NSString *)filename
-{
-    initial_action_done = YES;
-    return YES;
-}
-
-- (BOOL)application:(id)sender xx_openFileWithoutUI:(NSString *)filename
-{
-    initial_action_done = YES;
-    return YES;
-}
-
 @end