summaryrefslogtreecommitdiffstats
path: root/Mac/Python
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1996-09-06 00:30:45 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1996-09-06 00:30:45 (GMT)
commit3469e997b4cab1927737d45132b416efc17916bb (patch)
treefd6637a5dc712aba556c446e019159e2c8c70f28 /Mac/Python
parentc204c70c1a8a581ea0458657e81a6716404863f5 (diff)
downloadcpython-3469e997b4cab1927737d45132b416efc17916bb.zip
cpython-3469e997b4cab1927737d45132b416efc17916bb.tar.gz
cpython-3469e997b4cab1927737d45132b416efc17916bb.tar.bz2
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.
Diffstat (limited to 'Mac/Python')
-rw-r--r--Mac/Python/macglue.c32
-rw-r--r--Mac/Python/macmain.c6
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);