4 splash
= Dlg
.GetNewDialog(468, -1)
7 from Carbon
import Qd
, TE
, Fm
10 from Carbon
.Fonts
import *
11 from Carbon
.QuickDraw
import *
12 from Carbon
.TextEdit
import teJustCenter
19 _keepsplashscreenopen
= 0
21 abouttext1
= """The Python Integrated Development Environment for the Macintosh\xaa
23 Copyright 1997-2001 Just van Rossum, Letterror. <just@letterror.com>
26 See: <http://www.python.org/> for information and documentation."""
28 flauwekul
= [ "Goodday, Bruce.",
30 "Nudge, nudge, say no more!",
31 "No, no sir, it's not dead. It's resting.",
34 "Is your name not Bruce, then?",
35 """But Mr F.G. Superman has a secret identity . . .
36 when trouble strikes at any time . . .
37 at any place . . . he is ready to become . . .
38 Bicycle Repair Man!"""
41 def skipdoublereturns(text
):
42 return string
.replace(text
, '\n\n', '\n')
45 return string
.replace(text
, '\n', '\r')
47 def UpdateSplash(drawdialog
= 0, what
= 0):
51 splash
.GetDialogWindow().ValidWindowRect(splash
.GetDialogPort().portRect
)
52 Qd
.QDFlushPortBuffer(splash
.GetDialogWindow().GetWindowPort(), None)
54 def drawtext(what
= 0):
56 fontID
= Fm
.GetFNum("Python-Sans")
61 rect
= (10, 115, _about_width
- 10, _about_height
- 30)
64 abouttxt
= nl2return(abouttext1
% (
65 __main__
.__version
__, sys
.version
, skipdoublereturns(sys
.copyright
)))
68 abouttxt
= nl2return(random
.choice(flauwekul
))
69 TE
.TETextBox(abouttxt
, rect
, teJustCenter
)
74 from Carbon
import Evt
75 from Carbon
import Events
82 time
= Evt
.TickCount()
85 while _keepsplashscreenopen
:
86 ok
, event
= Evt
.EventAvail(Events
.highLevelEventMask
)
88 # got apple event, back to mainloop
90 ok
, event
= Evt
.EventAvail(Events
.mDownMask | Events
.keyDownMask | Events
.updateMask
)
92 ok
, event
= Evt
.WaitNextEvent(Events
.mDownMask | Events
.keyDownMask | Events
.updateMask
, 30)
94 (what
, message
, when
, where
, modifiers
) = event
95 if what
== Events
.updateEvt
:
96 if Win
.WhichWindow(message
) == splash
:
97 UpdateSplash(1, whattext
)
100 if Evt
.TickCount() - time
> 360:
101 whattext
= not whattext
103 time
= Evt
.TickCount()
108 global splash
, splashresfile
, _keepsplashscreenopen
109 _keepsplashscreenopen
= 1
110 splash
= Dlg
.GetNewDialog(468, -1)