summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2015-09-25 04:49:02 (GMT)
committerTerry Jan Reedy <tjreedy@udel.edu>2015-09-25 04:49:02 (GMT)
commit647412fb89521a2f939852caed06985fb35f156b (patch)
tree1e9792d4787d9247a0c7e9821ba1c722063815df
parentbdf1d0d0666a5c586913a5c0a0276e00de2fc37a (diff)
downloadcpython-647412fb89521a2f939852caed06985fb35f156b.zip
cpython-647412fb89521a2f939852caed06985fb35f156b.tar.gz
cpython-647412fb89521a2f939852caed06985fb35f156b.tar.bz2
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.
-rw-r--r--Lib/idlelib/help.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/idlelib/help.py b/Lib/idlelib/help.py
index c146db4..5f4fd35 100644
--- a/Lib/idlelib/help.py
+++ b/Lib/idlelib/help.py
@@ -28,6 +28,7 @@ from HTMLParser import HTMLParser
from os.path import abspath, dirname, isdir, isfile, join
from Tkinter import Tk, Toplevel, Frame, Text, Scrollbar, Menu, Menubutton
import tkFont as tkfont
+from idlelib.configHandler import idleConf
use_ttk = False # until available to import
if use_ttk:
@@ -161,8 +162,11 @@ class HelpText(Text):
"Display help.html."
def __init__(self, parent, filename):
"Configure tags and feed file to parser."
+ uwide = idleConf.GetOption('main', 'EditorWindow', 'width', type='int')
+ uhigh = idleConf.GetOption('main', 'EditorWindow', 'height', type='int')
+ uhigh = 3 * uhigh // 4 # lines average 4/3 of editor line height
Text.__init__(self, parent, wrap='word', highlightthickness=0,
- padx=5, borderwidth=0)
+ padx=5, borderwidth=0, width=uwide, height=uhigh)
normalfont = self.findfont(['TkDefaultFont', 'arial', 'helvetica'])
fixedfont = self.findfont(['TkFixedFont', 'monaco', 'courier'])