mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
#10768: fix ScrolledText widget construction, and make the example work from the interactive shell.
This commit is contained in:
parent
90b20675bd
commit
780d5e08c4
2 changed files with 5 additions and 4 deletions
|
@ -30,8 +30,8 @@ class ScrolledText(Text):
|
|||
# Copy geometry methods of self.frame without overriding Text
|
||||
# methods -- hack!
|
||||
text_meths = vars(Text).keys()
|
||||
methods = vars(Pack).keys() + vars(Grid).keys() + vars(Place).keys()
|
||||
methods = set(methods).difference(text_meths)
|
||||
methods = vars(Pack).keys() | vars(Grid).keys() | vars(Place).keys()
|
||||
methods = methods.difference(text_meths)
|
||||
|
||||
for m in methods:
|
||||
if m[0] != '_' and m != 'config' and m != 'configure':
|
||||
|
@ -42,11 +42,10 @@ class ScrolledText(Text):
|
|||
|
||||
|
||||
def example():
|
||||
import __main__
|
||||
from tkinter.constants import END
|
||||
|
||||
stext = ScrolledText(bg='white', height=10)
|
||||
stext.insert(END, __main__.__doc__)
|
||||
stext.insert(END, __doc__)
|
||||
stext.pack(fill=BOTH, side=LEFT, expand=True)
|
||||
stext.focus_set()
|
||||
stext.mainloop()
|
||||
|
|
|
@ -18,6 +18,8 @@ Core and Builtins
|
|||
Library
|
||||
-------
|
||||
|
||||
- Issue #10768: Make the Tkinter ScrolledText widget work again.
|
||||
|
||||
- Issue #10777: Fix "dictionary changed size during iteration" bug in
|
||||
ElementTree register_namespace().
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue