diff options
Diffstat (limited to 'Mac/Python')
-rw-r--r-- | Mac/Python/macglue.c | 32 | ||||
-rw-r--r-- | Mac/Python/macmain.c | 6 |
2 files changed, 38 insertions, 0 deletions
diff --git a/Mac/Python/macglue.c b/Mac/Python/macglue.c index 00d6d2c..17bbff0 100644 --- a/Mac/Python/macglue.c +++ b/Mac/Python/macglue.c @@ -68,6 +68,9 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include <GUSI.h> #endif +/* The ID of the Sioux apple menu */ +#define SIOUX_APPLEID 32000 + #ifndef HAVE_UNIVERSAL_HEADERS #define GetResourceSizeOnDisk(x) SizeResource(x) typedef DlgHookYDProcPtr DlgHookYDUPP; @@ -518,6 +521,35 @@ PyMac_Idle() #endif /* +** Install our menu bar. +*/ +void +PyMac_InitMenuBar() +{ + Handle bar; + MenuHandle applemenu; + + if ( (bar=GetMenuBar()) == NULL ) return; + if ( (applemenu=GetMHandle(SIOUX_APPLEID)) == NULL ) return; + SetMenuItemText(applemenu, 1, "\pAbout Python..."); +} + +/* +** Our replacement about box +*/ +void +SIOUXDoAboutBox(void) +{ + DialogPtr theDialog; + short item; + + if( (theDialog = GetNewDialog(ABOUT_ID, NULL, (WindowPtr)-1)) == NULL ) + return; + ModalDialog(NULL, &item); + DisposeDialog(theDialog); +} + +/* ** Returns true if the argument has a resource fork, and it contains ** a 'PYC ' resource of the correct name */ diff --git a/Mac/Python/macmain.c b/Mac/Python/macmain.c index 019e0be..a85f88f 100644 --- a/Mac/Python/macmain.c +++ b/Mac/Python/macmain.c @@ -351,6 +351,12 @@ Py_Main(argc, argv) } } + /* + ** For reasons I don't fully understand we cannot insert our + ** menu earlier. Leave it here, we hope to be rid of Sioux soon anyway. + */ + PyMac_InitMenuBar(); + Py_Initialize(); PySys_SetArgv(argc-1, argv+1); |