blob: cdf153d1420b59a5dfc232fe8ca2f49a82a71f8c [file] [log] [blame]
Just van Rossum40f9b7b1999-01-30 22:39:17 +00001"""Widgets for the Macintosh. Built on top of FrameWork"""
2
3__version__ = "0.3"
4
5from Wbase import *
6from Wcontrols import *
7from Wtext import *
8from Wlists import *
9from Wwindows import *
10from Wmenus import *
11
12_application = None
13_signature = None
14
15AlertError = 'AlertError'
16
17def setapplication(app, sig):
18 global _application, _signature
19 _application = app
20 _signature = sig
21
22def getapplication():
23 if _application is None:
24 raise WidgetsError, 'W not properly initialized: unknown Application'
25 return _application
26
Just van Rossumc2dab481999-09-26 12:17:04 +000027def getdefaultfont():
28 prefs = getapplication().getprefs()
29 if not prefs.defaultfont:
30 prefs.defaultfont = ("Python-Sans", 0, 9, (0, 0, 0))
31 return prefs.defaultfont
32
Just van Rossum40f9b7b1999-01-30 22:39:17 +000033def Message(text):
34 import EasyDialogs, Qd, string
35 Qd.InitCursor()
36 text = string.replace(text, "\n", "\r")
37 if not text:
38 text = '<Alert text not specified>'
39 EasyDialogs.Message(text)
40