summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/scrolledlist.py
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2016-06-10 22:19:21 (GMT)
committerTerry Jan Reedy <tjreedy@udel.edu>2016-06-10 22:19:21 (GMT)
commit01e35754fb8a7bcaf88a473db1eb30a14378a49e (patch)
tree66a35e9f29de268b16e00faa5a648cb12a45b743 /Lib/idlelib/scrolledlist.py
parent96881cd6218000380d4a6ce60ff47bb6d785e524 (diff)
downloadcpython-01e35754fb8a7bcaf88a473db1eb30a14378a49e.zip
cpython-01e35754fb8a7bcaf88a473db1eb30a14378a49e.tar.gz
cpython-01e35754fb8a7bcaf88a473db1eb30a14378a49e.tar.bz2
Issue *24750: Switch all scrollbars in IDLE to ttk versions.
Where needed, add minimal tests to cover changes.
Diffstat (limited to 'Lib/idlelib/scrolledlist.py')
-rw-r--r--Lib/idlelib/scrolledlist.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/Lib/idlelib/scrolledlist.py b/Lib/idlelib/scrolledlist.py
index 80df0f8..d0b6610 100644
--- a/Lib/idlelib/scrolledlist.py
+++ b/Lib/idlelib/scrolledlist.py
@@ -1,5 +1,6 @@
from tkinter import *
from idlelib import macosx
+from tkinter.ttk import Scrollbar
class ScrolledList:
@@ -124,22 +125,20 @@ class ScrolledList:
pass
-def _scrolled_list(parent):
- root = Tk()
- root.title("Test ScrolledList")
+def _scrolled_list(parent): # htest #
+ top = Toplevel(parent)
width, height, x, y = list(map(int, re.split('[x+]', parent.geometry())))
- root.geometry("+%d+%d"%(x, y + 150))
+ top.geometry("+%d+%d"%(x+200, y + 175))
class MyScrolledList(ScrolledList):
def fill_menu(self): self.menu.add_command(label="right click")
def on_select(self, index): print("select", self.get(index))
def on_double(self, index): print("double", self.get(index))
- scrolled_list = MyScrolledList(root)
+ scrolled_list = MyScrolledList(top)
for i in range(30):
scrolled_list.append("Item %02d" % i)
- root.mainloop()
-
if __name__ == '__main__':
+ # At the moment, test_scrolledlist merely creates instance, like htest.
from idlelib.idle_test.htest import run
run(_scrolled_list)