mirror of
https://github.com/python/cpython.git
synced 2025-11-03 11:23:31 +00:00
Add primitive customization of window size and font.
A few alternative selections can be made by changing "if 0" to "if 1".
This commit is contained in:
parent
795e189d28
commit
99aabe30ce
1 changed files with 19 additions and 3 deletions
|
|
@ -9,6 +9,23 @@ import tkMessageBox
|
||||||
import idlever
|
import idlever
|
||||||
import WindowList
|
import WindowList
|
||||||
|
|
||||||
|
# Customization of default window size and font
|
||||||
|
# standard
|
||||||
|
WIDTH = 80
|
||||||
|
HEIGHT = 24
|
||||||
|
if sys.platform[:3] == 'win':
|
||||||
|
FONT = ("courier new", 10)
|
||||||
|
else:
|
||||||
|
FONT = ("courier", 10)
|
||||||
|
if 0:
|
||||||
|
# for demos (on Windows)
|
||||||
|
WIDTH = 70
|
||||||
|
HEIGHT = 16
|
||||||
|
FONT = ("lucida console", 14)
|
||||||
|
if 0:
|
||||||
|
# for Windows 98
|
||||||
|
FONT = ("lucida console", 8)
|
||||||
|
|
||||||
# The default tab setting for a Text widget, in average-width characters.
|
# The default tab setting for a Text widget, in average-width characters.
|
||||||
TK_TABWIDTH_DEFAULT = 8
|
TK_TABWIDTH_DEFAULT = 8
|
||||||
|
|
||||||
|
|
@ -109,6 +126,7 @@ class EditorWindow:
|
||||||
highlightcolor=cprefs.CHilite[0],
|
highlightcolor=cprefs.CHilite[0],
|
||||||
highlightbackground=cprefs.CHilite[1],
|
highlightbackground=cprefs.CHilite[1],
|
||||||
insertbackground=cprefs.CCursor[1],
|
insertbackground=cprefs.CCursor[1],
|
||||||
|
width=WIDTH, height=HEIGHT,
|
||||||
wrap="none")
|
wrap="none")
|
||||||
|
|
||||||
self.createmenubar()
|
self.createmenubar()
|
||||||
|
|
@ -138,9 +156,7 @@ class EditorWindow:
|
||||||
vbar.pack(side=RIGHT, fill=Y)
|
vbar.pack(side=RIGHT, fill=Y)
|
||||||
|
|
||||||
text['yscrollcommand'] = vbar.set
|
text['yscrollcommand'] = vbar.set
|
||||||
if sys.platform[:3] == 'win':
|
text['font'] = FONT
|
||||||
text['font'] = ("lucida console", 8)
|
|
||||||
# text['font'] = ("courier new", 10)
|
|
||||||
text_frame.pack(side=LEFT, fill=BOTH, expand=1)
|
text_frame.pack(side=LEFT, fill=BOTH, expand=1)
|
||||||
text.pack(side=TOP, fill=BOTH, expand=1)
|
text.pack(side=TOP, fill=BOTH, expand=1)
|
||||||
text.focus_set()
|
text.focus_set()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue