]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
use PyMac_GetArgv (in macgetargv.c) for applet inits
authorGuido van Rossum <guido@python.org>
Sun, 19 Feb 1995 15:52:17 +0000 (15:52 +0000)
committerGuido van Rossum <guido@python.org>
Sun, 19 Feb 1995 15:52:17 +0000 (15:52 +0000)
Mac/Python/macglue.c

index 3c67221851c56dfeca406b2dbeb648561ca77794..d2797e7d28660757e35e7906ae753b18e2cc313e 100644 (file)
@@ -748,21 +748,10 @@ PyMac_BuildEventRecord(EventRecord *e)
 }
 
 
-/* What follows is used only by applets. */
-
-static void
-init_mac_world()
-{
-       MaxApplZone();
-       InitGraf(&qd.thePort);
-       InitFonts();
-       InitWindows();
-       TEInit();
-       InitDialogs((long)0);
-       InitMenus();
-       InitCursor();
-}
+/* ---------- */
+/* Applet support */
 
+/* Run a compiled Python Python script from 'PYC ' resource __main__ */
 static int
 run_main_resource()
 {
@@ -795,14 +784,16 @@ run_main_resource()
        return 0;
 }
 
+/* Initialization sequence for applets */
 void
 PyMac_InitApplet()
 {
-       static char *argv[] = {"__main__", NULL};
+       int argc;
+       char **argv;
        
-       init_mac_world();
+       argc = PyMac_GetArgv(&argv);
        Py_Initialize();
-       PySys_SetArgv((sizeof argv / sizeof argv[0]) - 1, argv);
+       PySys_SetArgv(argc, argv);
        run_main_resource();
        fflush(stderr);
        fflush(stdout);