blob: 81a91abb3d8213e7788b5163017a6efa19b035d9 [file] [log] [blame]
Jack Jansen6ad8d131997-01-15 16:53:37 +00001<HTML>
2<HEAD>
3<TITLE>Embedding Python on the Mac</TITLE>
4</HEAD>
5<BODY>
6<H1>Embedding Python on the Mac</H1>
7<HR>
8
9Embedding Python on the mac is pretty similar to embedding it on other
10platforms, but a few points need mentioning:
11
12<UL>
13<LI> You call <CODE>PyMac_Initialize()</CODE> in stead of
14<CODE>Py_Initialize()</CODE>. The prototype is in <CODE>macglue.h</CODE>.
15This call initializes the toolbox, GUSI (if needed), sets up the correct
16resource files and calls Py_Initialize.
17
18<LI> You have to be consequent in your use of GUSI. If the library uses
19it so should your program and vice versa.
20
21<LI> The console-behaviour (close-on-exit, etc) is controlled by Python,
22but you are of course free to change that after calling PyMac_Initialize().
23</UL>
24
25The Python environment is started with a dummy argc and argv, and initial
26startup options are obtained through the usual means, except that the
27user pression the option-key will not result in an interactive dialog.
28You can, however, set startup options on your program in the same way as you
29do for applets, by dragging your application to <code>EditPythonPrefs</code>. <p>
30
Jack Jansen3412c5d1997-08-27 14:08:22 +000031The most logical way to embed Python is to link it against the shared
32library <code>PythonCore</code>. An example project and source can be
33found in the <a href="embed">embed</a> folder.
Jack Jansen6ad8d131997-01-15 16:53:37 +000034
35</BODY>
36</HTML>