diff options
Diffstat (limited to 'Lib/idlelib/ScrolledList.py')
-rw-r--r-- | Lib/idlelib/ScrolledList.py | 19 |
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) |