diff Mac/Python/macglue.c @ 4215:0410ed3808ee legacy-trunk

Python about box implemented. Slightly convoluted, since (a) we have to override an internal sioux routine and (b) we have to override the "about sioux" menuitem after sioux has created its menus.
author Jack Jansen <jack.jansen@cwi.nl>
date Fri, 06 Sep 1996 00:30:45 +0000
parents 3126f8a146a6
children 6c86d9136c09
line wrap: on
line diff
--- a/Mac/Python/macglue.c	Thu Sep 05 19:07:11 1996 +0000
+++ b/Mac/Python/macglue.c	Fri Sep 06 00:30:45 1996 +0000
@@ -68,6 +68,9 @@
 #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 @@
 #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
 */