Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 99aabe3

Browse files
committed
Add primitive customization of window size and font.
A few alternative selections can be made by changing "if 0" to "if 1".
1 parent 795e189 commit 99aabe3

1 file changed

Lines changed: 19 additions & 3 deletions

File tree

Tools/idle/EditorWindow.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,23 @@
99
import idlever
1010
import WindowList
1111

12+
# Customization of default window size and font
13+
# standard
14+
WIDTH = 80
15+
HEIGHT = 24
16+
if sys.platform[:3] == 'win':
17+
FONT = ("courier new", 10)
18+
else:
19+
FONT = ("courier", 10)
20+
if 0:
21+
# for demos (on Windows)
22+
WIDTH = 70
23+
HEIGHT = 16
24+
FONT = ("lucida console", 14)
25+
if 0:
26+
# for Windows 98
27+
FONT = ("lucida console", 8)
28+
1229
# The default tab setting for a Text widget, in average-width characters.
1330
TK_TABWIDTH_DEFAULT = 8
1431

@@ -109,6 +126,7 @@ def __init__(self, flist=None, filename=None, key=None, root=None):
109126
highlightcolor=cprefs.CHilite[0],
110127
highlightbackground=cprefs.CHilite[1],
111128
insertbackground=cprefs.CCursor[1],
129+
width=WIDTH, height=HEIGHT,
112130
wrap="none")
113131

114132
self.createmenubar()
@@ -138,9 +156,7 @@ def __init__(self, flist=None, filename=None, key=None, root=None):
138156
vbar.pack(side=RIGHT, fill=Y)
139157

140158
text['yscrollcommand'] = vbar.set
141-
if sys.platform[:3] == 'win':
142-
text['font'] = ("lucida console", 8)
143-
# text['font'] = ("courier new", 10)
159+
text['font'] = FONT
144160
text_frame.pack(side=LEFT, fill=BOTH, expand=1)
145161
text.pack(side=TOP, fill=BOTH, expand=1)
146162
text.focus_set()

0 commit comments

Comments
 (0)