This commit was manufactured by cvs2svn to create tag 'r23b1-mac'.
[python/dscho.git] / Mac / Tools / IDE / W.py
blob397b2117c1f71d5f311cdace5dbfae4290be0908
1 """Widgets for the Macintosh. Built on top of FrameWork"""
3 __version__ = "0.3"
5 from Wbase import *
6 from Wcontrols import *
7 from Wtext import *
8 from Wlists import *
9 from Wwindows import *
10 from Wmenus import *
12 _application = None
13 _signature = None
15 AlertError = 'AlertError'
17 def setapplication(app, sig):
18 global _application, _signature
19 _application = app
20 _signature = sig
22 def getapplication():
23 if _application is None:
24 raise WidgetsError, 'W not properly initialized: unknown Application'
25 return _application
27 def getdefaultfont():
28 prefs = getapplication().getprefs()
29 if not prefs.defaultfont:
30 prefs.defaultfont = ("Geneva", 0, 10, (0, 0, 0))
31 return prefs.defaultfont
33 def Message(text):
34 import EasyDialogs, string
35 from Carbon import Qd
36 Qd.InitCursor()
37 text = string.replace(text, "\n", "\r")
38 if not text:
39 text = '<Alert text not specified>'
40 EasyDialogs.Message(text)