summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/ScrolledList.py
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2014-05-24 22:48:45 (GMT)
committerTerry Jan Reedy <tjreedy@udel.edu>2014-05-24 22:48:45 (GMT)
commite84d26c61b826792f62d49cda64f1f8c76dcf55c (patch)
tree720913411be719c939a8822874330ad1dcf55be2 /Lib/idlelib/ScrolledList.py
parentded3c1b83774b3ca29ec2618f4f4166c7d8e90f2 (diff)
parent1b392ffe67febbe8740520289bb828fdf060e363 (diff)
downloadcpython-e84d26c61b826792f62d49cda64f1f8c76dcf55c.zip
cpython-e84d26c61b826792f62d49cda64f1f8c76dcf55c.tar.gz
cpython-e84d26c61b826792f62d49cda64f1f8c76dcf55c.tar.bz2
Merge with 3.4
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)