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

Skip to content

Commit 52736dd

Browse files
committed
Issue #25198: Idle doc viewer now uses user width and height setting.
The height is reduced by 3/4 to account for extra spacing between lines, relative to an Idle editor, and extra tall header lines.
1 parent ce021db commit 52736dd

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Lib/idlelib/help.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
from os.path import abspath, dirname, isdir, isfile, join
2929
from tkinter import Tk, Toplevel, Frame, Text, Scrollbar, Menu, Menubutton
3030
from tkinter import font as tkfont
31+
from idlelib.configHandler import idleConf
3132

3233
use_ttk = False # until available to import
3334
if use_ttk:
@@ -158,8 +159,11 @@ class HelpText(Text):
158159
"Display help.html."
159160
def __init__(self, parent, filename):
160161
"Configure tags and feed file to parser."
162+
uwide = idleConf.GetOption('main', 'EditorWindow', 'width', type='int')
163+
uhigh = idleConf.GetOption('main', 'EditorWindow', 'height', type='int')
164+
uhigh = 3 * uhigh // 4 # lines average 4/3 of editor line height
161165
Text.__init__(self, parent, wrap='word', highlightthickness=0,
162-
padx=5, borderwidth=0)
166+
padx=5, borderwidth=0, width=uwide, height=uhigh)
163167

164168
normalfont = self.findfont(['TkDefaultFont', 'arial', 'helvetica'])
165169
fixedfont = self.findfont(['TkFixedFont', 'monaco', 'courier'])

0 commit comments

Comments
 (0)