*/
if( in_here > 1 || !schedparams.process_events ||
(python_event_handler && !maycallpython) ) {
-#if !TARGET_API_MAC_CARBON
if ( maxsleep >= 0 ) {
+#if !TARGET_API_MAC_CARBON
SystemTask();
- }
+#else
+ int xxx = 0;
#endif
+ }
} else {
latest_time_ready = LMGetTicks() + maxsleep;
do {
{
MenuHandle applemenu;
+ if ( sioux_mbar ) return;
if ( (sioux_mbar=GetMenuBar()) == NULL ) {
/* Sioux menu not installed yet. Do so */
SIOUXSetupMenus();
void
PyMac_RestoreMenuBar()
{
-#if 0
+#if 1
/* This doesn't seem to work anymore? Or only for Carbon? */
MenuBarHandle curmenubar;
#endif
}
+void
+PyMac_RaiseConsoleWindow()
+{
+ /* Note: this is a hack. SIOUXTextWindow is SIOUX's internal structure
+ ** and we happen to know that the first entry is the window pointer.
+ */
+ extern WindowRef *SIOUXTextWindow;
+
+ if ( SIOUXTextWindow == NULL || *SIOUXTextWindow == NULL )
+ return;
+ if ( FrontWindow() != *SIOUXTextWindow )
+ BringToFront(*SIOUXTextWindow);
+}
/*
** Our replacement about box
PyMac_InitMenuBar();
console_output_state = STATE_LASTWRITE;
}
-
+
+/*
+** Override abort() - The default one is not what we want.
+*/
+void
+abort()
+{
+ console_output_state = STATE_LASTWRITE;
+ PyMac_Exit(1);
+}
/*
** Terminate application
SIOUXSettings.standalone = 1;
SIOUXSettings.autocloseonquit = 0;
SIOUXSetTitle("\p\307terminated\310");
+ PyMac_RaiseConsoleWindow();
PyMac_RestoreMenuBar();
#ifdef USE_MSL
/*
GUSISetHook(GUSI_EventHook+diskEvt, (GUSIHook)SIOUXHandleOneEvent);
GUSISetHook(GUSI_EventHook+activateEvt, (GUSIHook)SIOUXHandleOneEvent);
GUSISetHook(GUSI_EventHook+osEvt, (GUSIHook)SIOUXHandleOneEvent);
+ PyMac_InitMenuBar();
}
GUSISIOUXSocket::~GUSISIOUXSocket()
{
if ( !initialized ) Initialize();
GUSIStdioFlush();
PyMac_OutputSeen();
+ PyMac_RaiseConsoleWindow();
return buffer.SetLength(
ReadCharsFromConsole((char *) buffer.Buffer(), (int)buffer.Length()));
GUSIContext::Yield(kGUSIPoll);