summaryrefslogtreecommitdiffstats
path: root/Mac/Tools/IDE/Wtext.py
diff options
context:
space:
mode:
authorJust van Rossum <just@lettererror.com>1999-09-26 12:21:32 (GMT)
committerJust van Rossum <just@lettererror.com>1999-09-26 12:21:32 (GMT)
commitb7ad821f022a62656677b03f1d081e1e284047ea (patch)
tree20d0c62f2879c8cc10eaea1159f2e652f5ad7b52 /Mac/Tools/IDE/Wtext.py
parent03bca30ea1b576abe190d3ad8922c3a9624a6606 (diff)
downloadcpython-b7ad821f022a62656677b03f1d081e1e284047ea.zip
cpython-b7ad821f022a62656677b03f1d081e1e284047ea.tar.gz
cpython-b7ad821f022a62656677b03f1d081e1e284047ea.tar.bz2
Added support for global default font settings. (jvr)
Diffstat (limited to 'Mac/Tools/IDE/Wtext.py')
-rw-r--r--Mac/Tools/IDE/Wtext.py40
1 files changed, 22 insertions, 18 deletions
diff --git a/Mac/Tools/IDE/Wtext.py b/Mac/Tools/IDE/Wtext.py
index 963f1ba..ac9d48e 100644
--- a/Mac/Tools/IDE/Wtext.py
+++ b/Mac/Tools/IDE/Wtext.py
@@ -24,11 +24,13 @@ class TextBox(Wbase.Widget):
"""A static text widget"""
- def __init__(self, possize, text = "", align = TextEdit.teJustLeft,
- fontsettings = ("Python-Sans", 0, 9, (0, 0, 0)),
- backgroundcolor = (0xffff, 0xffff, 0xffff)
+ def __init__(self, possize, text="", align=TextEdit.teJustLeft,
+ fontsettings=None,
+ backgroundcolor=(0xffff, 0xffff, 0xffff)
):
-
+ if fontsettings is None:
+ import W
+ fontsettings = W.getdefaultfont()
Wbase.Widget.__init__(self, possize)
self.fontsettings = fontsettings
self.text = text
@@ -90,12 +92,14 @@ class EditText(Wbase.SelectableWidget, _ScrollWidget):
"""A text edit widget, mainly for simple entry fields."""
- def __init__(self, possize, text = "",
- callback = None, inset = (3, 3),
- fontsettings = ("Python-Sans", 0, 9, (0, 0, 0)),
+ def __init__(self, possize, text="",
+ callback=None, inset=(3, 3),
+ fontsettings=None,
tabsettings = (32, 0),
readonly = 0):
-
+ if fontsettings is None:
+ import W
+ fontsettings = W.getdefaultfont()
Wbase.SelectableWidget.__init__(self, possize)
self.temptext = text
self.ted = None
@@ -553,10 +557,10 @@ class TextEditor(EditText):
"""A text edit widget."""
- def __init__(self, possize, text = "", callback = None, wrap = 1, inset = (4, 4),
- fontsettings = ("Python-Sans", 0, 9, (0, 0, 0)),
- tabsettings = (32, 0),
- readonly = 0):
+ def __init__(self, possize, text="", callback=None, wrap=1, inset=(4, 4),
+ fontsettings=None,
+ tabsettings=(32, 0),
+ readonly=0):
EditText.__init__(self, possize, text, callback, inset, fontsettings, tabsettings, readonly)
self.wrap = wrap
@@ -607,12 +611,12 @@ class PyEditor(TextEditor):
"""A specialized Python source edit widget"""
- def __init__(self, possize, text = "", callback = None, inset = (4, 4),
- fontsettings = ("Python-Sans", 0, 9, (0, 0, 0)),
- tabsettings = (32, 0),
- readonly = 0,
- debugger = None,
- file = ''):
+ def __init__(self, possize, text="", callback=None, inset=(4, 4),
+ fontsettings=None,
+ tabsettings=(32, 0),
+ readonly=0,
+ debugger=None,
+ file=''):
TextEditor.__init__(self, possize, text, callback, 0, inset, fontsettings, tabsettings, readonly)
self.bind("cmd[", self.domenu_shiftleft)
self.bind("cmd]", self.domenu_shiftright)