mirror of
https://github.com/python/cpython.git
synced 2025-07-09 20:35:26 +00:00
bpo-34548: IDLE: use configured theme colors in TextView (GH-9008)
https://bugs.python.org/issue34548
This commit is contained in:
parent
24b447edf2
commit
c87d9f406b
3 changed files with 12 additions and 9 deletions
|
@ -5,6 +5,8 @@ from tkinter import Toplevel, Text
|
|||
from tkinter.ttk import Frame, Scrollbar, Button
|
||||
from tkinter.messagebox import showerror
|
||||
|
||||
from idlelib.colorizer import color_config
|
||||
|
||||
|
||||
class TextFrame(Frame):
|
||||
"Display text with scrollbar."
|
||||
|
@ -18,12 +20,9 @@ class TextFrame(Frame):
|
|||
super().__init__(parent)
|
||||
self['relief'] = 'sunken'
|
||||
self['height'] = 700
|
||||
# TODO: get fg/bg from theme.
|
||||
self.bg = '#ffffff'
|
||||
self.fg = '#000000'
|
||||
|
||||
self.text = text = Text(self, wrap='word', highlightthickness=0,
|
||||
fg=self.fg, bg=self.bg)
|
||||
self.text = text = Text(self, wrap='word', highlightthickness=0)
|
||||
color_config(text)
|
||||
self.scroll = scroll = Scrollbar(self, orient='vertical',
|
||||
takefocus=False, command=text.yview)
|
||||
text['yscrollcommand'] = scroll.set
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue