From 01e35754fb8a7bcaf88a473db1eb30a14378a49e Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Fri, 10 Jun 2016 18:19:21 -0400 Subject: Issue *24750: Switch all scrollbars in IDLE to ttk versions. Where needed, add minimal tests to cover changes. --- Lib/idlelib/scrolledlist.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'Lib/idlelib/scrolledlist.py') diff --git a/Lib/idlelib/scrolledlist.py b/Lib/idlelib/scrolledlist.py index 80df0f8132..d0b66107ac 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) -- cgit v1.2.1