Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Lib/idlelib/NEWS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ bpo-26353: Stop adding newline when saving an IDLE shell window.

bpo-38598: Do not try to compile IDLE shell or output windows.

bpo-23937: Add option to maximise IDLE windows on load
(applies for both shell and editor windows).


What's New in IDLE 3.8.0 (since 3.7.0)
Released on 2019-10-14
Expand Down
1 change: 1 addition & 0 deletions Lib/idlelib/config-main.def
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ print-command-win=start /min notepad /p %%s
delete-exitfunc= 1

[EditorWindow]
max= 0
width= 80
height= 40
cursor-blink= 1
Expand Down
18 changes: 17 additions & 1 deletion Lib/idlelib/configdialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -1817,6 +1817,7 @@ def create_page_general(self):
(*)startup_shell_on: Radiobutton - startup_edit
frame_win_size: Frame
win_size_title: Label
(*)win_max_title: Checkbutton - win_max
win_width_title: Label
(*)win_width_int: Entry - win_width
win_height_title: Label
Expand Down Expand Up @@ -1864,6 +1865,8 @@ def create_page_general(self):
# Integer values need StringVar because int('') raises.
self.startup_edit = tracers.add(
IntVar(self), ('main', 'General', 'editor-on-startup'))
self.win_max = tracers.add(
BooleanVar(self), ('main', 'EditorWindow', 'max'))
self.win_width = tracers.add(
StringVar(self), ('main', 'EditorWindow', 'width'))
self.win_height = tracers.add(
Expand Down Expand Up @@ -1915,6 +1918,8 @@ def create_page_general(self):
frame_win_size = Frame(frame_window, borderwidth=0)
win_size_title = Label(
frame_win_size, text='Initial Window Size (in characters)')
win_max_title = Checkbutton(frame_win_size, text='Maximised', variable=self.win_max)
self.win_max.trace("w", lambda a, b, c: self.toggle_entry_mode())
win_width_title = Label(frame_win_size, text='Width')
self.win_width_int = Entry(
frame_win_size, textvariable=self.win_width, width=3,
Expand Down Expand Up @@ -2030,7 +2035,8 @@ def create_page_general(self):
self.startup_editor_on.pack(side=RIGHT, anchor=W, padx=5, pady=5)
# frame_win_size.
frame_win_size.pack(side=TOP, padx=5, pady=0, fill=X)
win_size_title.pack(side=LEFT, anchor=W, padx=5, pady=5)
win_size_title.pack(side=LEFT, anchor=NW, padx=5, pady=5)
win_max_title.pack(side=TOP, anchor=E, padx=10, pady=5)
self.win_height_int.pack(side=RIGHT, anchor=E, padx=10, pady=5)
win_height_title.pack(side=RIGHT, anchor=E, pady=5)
self.win_width_int.pack(side=RIGHT, anchor=E, padx=10, pady=5)
Expand Down Expand Up @@ -2089,6 +2095,8 @@ def load_general_cfg(self):
# Set variables for all windows.
self.startup_edit.set(idleConf.GetOption(
'main', 'General', 'editor-on-startup', type='bool'))
self.win_max.set(idleConf.GetOption(
'main', 'EditorWindow', 'max', type='bool'))
self.win_width.set(idleConf.GetOption(
'main', 'EditorWindow', 'width', type='int'))
self.win_height.set(idleConf.GetOption(
Expand Down Expand Up @@ -2125,6 +2133,14 @@ def load_general_cfg(self):
self.helplist.insert(END, help_item[0])
self.set_add_delete_state()

def toggle_entry_mode(self):
if self.win_max.get():
state = "disabled"
else:
state = "normal"
self.win_width_int.config(state=state)
self.win_height_int.config(state=state)

def help_source_selected(self, event):
"Handle event for selecting additional help."
self.set_add_delete_state()
Expand Down
5 changes: 5 additions & 0 deletions Lib/idlelib/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ def __init__(self, flist=None, filename=None, key=None, root=None):
self.root = root
self.menubar = Menu(root)
self.top = top = window.ListedToplevel(root, menu=self.menubar)
if idleConf.GetOption('main', 'EditorWindow', 'max', type='bool'):
if sys.platform[:3] == 'win':
self.top.state('zoomed')
else:
self.top.attributes('-zoomed', True)
if flist:
self.tkinter_vars = flist.vars
#self.top.instance_dict makes flist.inversedict available to
Expand Down