From 0fe43be4e1abcd24bb503bf4ee150b08e02e4322 Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Fri, 10 Jun 2016 18:19:21 -0400 Subject: Issue *24750: Switch all scrollbars in IDLE to ttk versions. Where needed, add minimal tests to cover changes. --- Lib/idlelib/help.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'Lib/idlelib/help.py') diff --git a/Lib/idlelib/help.py b/Lib/idlelib/help.py index 00930151dc..d18d1ca3f2 100644 --- a/Lib/idlelib/help.py +++ b/Lib/idlelib/help.py @@ -26,14 +26,11 @@ show_idlehelp - Create HelpWindow. Called in EditorWindow.help_dialog. """ from html.parser import HTMLParser from os.path import abspath, dirname, isfile, join -from tkinter import Toplevel, Frame, Text, Scrollbar, Menu, Menubutton +from tkinter import Toplevel, Frame, Text, Menu +from tkinter.ttk import Menubutton, Scrollbar from tkinter import font as tkfont from idlelib.config import idleConf -use_ttk = False # until available to import -if use_ttk: - from tkinter.ttk import Menubutton - ## About IDLE ## @@ -196,15 +193,18 @@ class HelpFrame(Frame): "Display html text, scrollbar, and toc." def __init__(self, parent, filename): Frame.__init__(self, parent) - text = HelpText(self, filename) + # keep references to widgets for test access. + self.text = text = HelpText(self, filename) self['background'] = text['background'] - scroll = Scrollbar(self, command=text.yview) + self.toc = toc = self.toc_menu(text) + self.scroll = scroll = Scrollbar(self, command=text.yview) text['yscrollcommand'] = scroll.set + self.rowconfigure(0, weight=1) self.columnconfigure(1, weight=1) # text - self.toc_menu(text).grid(column=0, row=0, sticky='nw') - text.grid(column=1, row=0, sticky='nsew') - scroll.grid(column=2, row=0, sticky='ns') + toc.grid(row=0, column=0, sticky='nw') + text.grid(row=0, column=1, sticky='nsew') + scroll.grid(row=0, column=2, sticky='ns') def toc_menu(self, text): "Create table of contents as drop-down menu." @@ -265,7 +265,7 @@ def show_idlehelp(parent): if not isfile(filename): # try copy_strip, present message return - HelpWindow(parent, filename, 'IDLE Help') + return HelpWindow(parent, filename, 'IDLE Help') if __name__ == '__main__': from idlelib.idle_test.htest import run -- cgit v1.2.1 From 03c72086eea7efd488f3d7eb42f383cc81bd9a6b Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Wed, 31 Aug 2016 00:50:55 -0400 Subject: Issue #27891: Consistently group and sort imports within idlelib modules. --- Lib/idlelib/help.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Lib/idlelib/help.py') diff --git a/Lib/idlelib/help.py b/Lib/idlelib/help.py index 03d6ea24e0..77e01a31c0 100644 --- a/Lib/idlelib/help.py +++ b/Lib/idlelib/help.py @@ -27,9 +27,11 @@ show_idlehelp - Create HelpWindow. Called in EditorWindow.help_dialog. from html.parser import HTMLParser from os.path import abspath, dirname, isfile, join from platform import python_version + from tkinter import Toplevel, Frame, Text, Menu from tkinter.ttk import Menubutton, Scrollbar from tkinter import font as tkfont + from idlelib.config import idleConf ## About IDLE ## -- cgit v1.2.1