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.
This commit is contained in:
Jack Jansen 1996-09-06 00:30:45 +00:00
parent c204c70c1a
commit 3469e997b4
5 changed files with 463 additions and 58 deletions

View file

@ -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;
@ -517,6 +520,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