Modified to work together with BBPy

Re-enabled splash screen
This commit is contained in:
Jack Jansen 1996-10-23 15:38:26 +00:00
parent d804bab721
commit 92ca16c335
3 changed files with 931 additions and 917 deletions

View file

@ -17,6 +17,7 @@ import mactwit_stack
import mactwit_browser
import mactwit_edit
import macfs
import string
# Resource-id (for checking existence)
ID_MODULES=512
@ -37,6 +38,7 @@ class Twit(FrameWork.Application, TwitCore.Application, MiniAEFrame.AEServer):
AE.AESetInteractionAllowed(AppleEvents.kAEInteractWithAll)
self.installaehandler('aevt', 'odoc', self.ae_open_doc)
self.installaehandler('aevt', 'quit', self.do_quit)
self.installaehandler('pyth', 'EXEC', self.do_bbpyexec) # BBpy execute event
self.dbg_menu_bar = Menu.GetMenuBar()
self.setstate(sessiontype)
@ -175,6 +177,19 @@ class Twit(FrameWork.Application, TwitCore.Application, MiniAEFrame.AEServer):
fss, changed = object.Resolve()
self.runfile(fss.as_pathname())
def do_bbpyexec(self, object=None, NAME=None, **args):
if type(object) <> type(''):
if AE.AEInteractWithUser(AppleEvents.kAEDefaultTimeout) == 0:
EasyDialogs.Message('EXEC AppleEvent arg should be a string')
return
if self.state <> 'none':
if AE.AEInteractWithUser(AppleEvents.kAEDefaultTimeout) == 0:
if not self.asknewsession():
return
stuff = string.splitfields(object, '\r')
stuff = string.joinfields(stuff, '\n')
self.runstring(stuff)
def do_run(self, *args):
if not self.asknewsession():
return

View file

@ -12,9 +12,8 @@ Jack Jansen, CWI, August 1996."""
import os
if os.name == 'mac':
# Not supported in distributed 1.4b3:
## import MacOS
## MacOS.splash(515) # Try to show the splash screen
import MacOS
MacOS.splash(515) # Try to show the splash screen
import mactwit_app; twit_app = mactwit_app
else:
try:
@ -32,8 +31,8 @@ import sys
def main():
twit_app.Initialize()
## if os.name == 'mac':
## MacOS.splash()
if os.name == 'mac':
MacOS.splash()
twit_app.Twit('none', None)
def run(statement, globals=None, locals=None):

File diff suppressed because it is too large Load diff