bpo-33987: IDLE: Use ttk Frame on doc window and statusbar (GH-11433)

This commit is contained in:
Cheryl Sabella 2020-10-22 15:14:35 -04:00 committed by GitHub
parent e76b8fc815
commit facb522d44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 5 deletions

View File

@ -28,8 +28,8 @@ from html.parser import HTMLParser
from os.path import abspath, dirname, isfile, join from os.path import abspath, dirname, isfile, join
from platform import python_version from platform import python_version
from tkinter import Toplevel, Frame, Text, Menu from tkinter import Toplevel, Text, Menu
from tkinter.ttk import Menubutton, Scrollbar from tkinter.ttk import Frame, Menubutton, Scrollbar, Style
from tkinter import font as tkfont from tkinter import font as tkfont
from idlelib.config import idleConf from idlelib.config import idleConf
@ -212,7 +212,9 @@ class HelpFrame(Frame):
def __init__(self, parent, filename): def __init__(self, parent, filename):
Frame.__init__(self, parent) Frame.__init__(self, parent)
self.text = text = HelpText(self, filename) self.text = text = HelpText(self, filename)
self['background'] = text['background'] self.style = Style(parent)
self['style'] = 'helpframe.TFrame'
self.style.configure('helpframe.TFrame', background=text['background'])
self.toc = toc = self.toc_menu(text) self.toc = toc = self.toc_menu(text)
self.scroll = scroll = Scrollbar(self, command=text.yview) self.scroll = scroll = Scrollbar(self, command=text.yview)
text['yscrollcommand'] = scroll.set text['yscrollcommand'] = scroll.set

View File

@ -1,4 +1,5 @@
from tkinter import Frame, Label from tkinter import Label
from tkinter.ttk import Frame
class MultiStatusBar(Frame): class MultiStatusBar(Frame):
@ -20,7 +21,8 @@ class MultiStatusBar(Frame):
def _multistatus_bar(parent): # htest # def _multistatus_bar(parent): # htest #
from tkinter import Toplevel, Frame, Text, Button from tkinter import Toplevel, Text
from tkinter.ttk import Frame, Button
top = Toplevel(parent) top = Toplevel(parent)
x, y = map(int, parent.geometry().split('+')[1:]) x, y = map(int, parent.geometry().split('+')[1:])
top.geometry("+%d+%d" %(x, y + 175)) top.geometry("+%d+%d" %(x, y + 175))