diff options
author | Guido van Rossum <guido@python.org> | 1995-02-19 15:52:17 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1995-02-19 15:52:17 (GMT) |
commit | 8c89a6fdc7142941150cd62253a07d1f79865b49 (patch) | |
tree | 2606ffe59253f886e4835af2eb9a0384e44047e3 | |
parent | dbfb282d2c2dcf1c6f2dad0ba01a394767388ac1 (diff) | |
download | cpython-8c89a6fdc7142941150cd62253a07d1f79865b49.zip cpython-8c89a6fdc7142941150cd62253a07d1f79865b49.tar.gz cpython-8c89a6fdc7142941150cd62253a07d1f79865b49.tar.bz2 |
use PyMac_GetArgv (in macgetargv.c) for applet inits
-rw-r--r-- | Mac/Python/macglue.c | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/Mac/Python/macglue.c b/Mac/Python/macglue.c index 3c67221..d2797e7 100644 --- a/Mac/Python/macglue.c +++ b/Mac/Python/macglue.c @@ -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); |