Kaydet (Commit) 92ca16c3 authored tarafından Jack Jansen's avatar Jack Jansen

Modified to work together with BBPy

Re-enabled splash screen
üst d804bab7
...@@ -17,6 +17,7 @@ import mactwit_stack ...@@ -17,6 +17,7 @@ import mactwit_stack
import mactwit_browser import mactwit_browser
import mactwit_edit import mactwit_edit
import macfs import macfs
import string
# Resource-id (for checking existence) # Resource-id (for checking existence)
ID_MODULES=512 ID_MODULES=512
...@@ -37,6 +38,7 @@ class Twit(FrameWork.Application, TwitCore.Application, MiniAEFrame.AEServer): ...@@ -37,6 +38,7 @@ class Twit(FrameWork.Application, TwitCore.Application, MiniAEFrame.AEServer):
AE.AESetInteractionAllowed(AppleEvents.kAEInteractWithAll) AE.AESetInteractionAllowed(AppleEvents.kAEInteractWithAll)
self.installaehandler('aevt', 'odoc', self.ae_open_doc) self.installaehandler('aevt', 'odoc', self.ae_open_doc)
self.installaehandler('aevt', 'quit', self.do_quit) self.installaehandler('aevt', 'quit', self.do_quit)
self.installaehandler('pyth', 'EXEC', self.do_bbpyexec) # BBpy execute event
self.dbg_menu_bar = Menu.GetMenuBar() self.dbg_menu_bar = Menu.GetMenuBar()
self.setstate(sessiontype) self.setstate(sessiontype)
...@@ -175,6 +177,19 @@ class Twit(FrameWork.Application, TwitCore.Application, MiniAEFrame.AEServer): ...@@ -175,6 +177,19 @@ class Twit(FrameWork.Application, TwitCore.Application, MiniAEFrame.AEServer):
fss, changed = object.Resolve() fss, changed = object.Resolve()
self.runfile(fss.as_pathname()) 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): def do_run(self, *args):
if not self.asknewsession(): if not self.asknewsession():
return return
......
...@@ -12,9 +12,8 @@ Jack Jansen, CWI, August 1996.""" ...@@ -12,9 +12,8 @@ Jack Jansen, CWI, August 1996."""
import os import os
if os.name == 'mac': if os.name == 'mac':
# Not supported in distributed 1.4b3: import MacOS
## import MacOS MacOS.splash(515) # Try to show the splash screen
## MacOS.splash(515) # Try to show the splash screen
import mactwit_app; twit_app = mactwit_app import mactwit_app; twit_app = mactwit_app
else: else:
try: try:
...@@ -32,8 +31,8 @@ import sys ...@@ -32,8 +31,8 @@ import sys
def main(): def main():
twit_app.Initialize() twit_app.Initialize()
## if os.name == 'mac': if os.name == 'mac':
## MacOS.splash() MacOS.splash()
twit_app.Twit('none', None) twit_app.Twit('none', None)
def run(statement, globals=None, locals=None): def run(statement, globals=None, locals=None):
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment