summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/ScrolledList.py
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2014-05-24 22:48:18 (GMT)
committerTerry Jan Reedy <tjreedy@udel.edu>2014-05-24 22:48:18 (GMT)
commit1b392ffe67febbe8740520289bb828fdf060e363 (patch)
tree27d5496ec5479afd9d1a36efcd02614315e7c447 /Lib/idlelib/ScrolledList.py
parent10cbb1e463378391d2368874bb31af0447fa73e6 (diff)
downloadcpython-1b392ffe67febbe8740520289bb828fdf060e363.zip
cpython-1b392ffe67febbe8740520289bb828fdf060e363.tar.gz
cpython-1b392ffe67febbe8740520289bb828fdf060e363.tar.bz2
Issue #21477: Idle htest: merge and modify run and runall; add many tests.
Patch by Saimadhav Heblikar
Diffstat (limited to 'Lib/idlelib/ScrolledList.py')
-rw-r--r--Lib/idlelib/ScrolledList.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/Lib/idlelib/ScrolledList.py b/Lib/idlelib/ScrolledList.py
index 0255a0a..71ec547 100644
--- a/Lib/idlelib/ScrolledList.py
+++ b/Lib/idlelib/ScrolledList.py
@@ -119,21 +119,22 @@ class ScrolledList:
pass
-def test():
+def _scrolled_list(parent):
root = Tk()
- root.protocol("WM_DELETE_WINDOW", root.destroy)
+ root.title("Test ScrolledList")
+ width, height, x, y = list(map(int, re.split('[x+]', parent.geometry())))
+ root.geometry("+%d+%d"%(x, y + 150))
class MyScrolledList(ScrolledList):
- def fill_menu(self): self.menu.add_command(label="pass")
+ 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))
- s = MyScrolledList(root)
+
+ scrolled_list = MyScrolledList(root)
for i in range(30):
- s.append("item %02d" % i)
- return root
+ scrolled_list.append("Item %02d" % i)
-def main():
- root = test()
root.mainloop()
if __name__ == '__main__':
- main()
+ from idlelib.idle_test.htest import run
+ run(_scrolled_list)