summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-12-28 10:56:20 (GMT)
committerGeorg Brandl <georg@python.org>2010-12-28 10:56:20 (GMT)
commit780d5e08c45f7f1cf20bde38e0c98dc9e576eeb8 (patch)
treef04a9fbffc97a20721d6fbf659640cfa4085e628
parent90b20675bd042a3262642232f9d3e133e56a130c (diff)
downloadcpython-780d5e08c45f7f1cf20bde38e0c98dc9e576eeb8.zip
cpython-780d5e08c45f7f1cf20bde38e0c98dc9e576eeb8.tar.gz
cpython-780d5e08c45f7f1cf20bde38e0c98dc9e576eeb8.tar.bz2
#10768: fix ScrolledText widget construction, and make the example work from the interactive shell.
-rw-r--r--Lib/tkinter/scrolledtext.py7
-rw-r--r--Misc/NEWS2
2 files changed, 5 insertions, 4 deletions
diff --git a/Lib/tkinter/scrolledtext.py b/Lib/tkinter/scrolledtext.py
index 8173f5e..9aa936a 100644
--- a/Lib/tkinter/scrolledtext.py
+++ b/Lib/tkinter/scrolledtext.py
@@ -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()
diff --git a/Misc/NEWS b/Misc/NEWS
index 46b6233..38709af 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -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().