diff options
| author | Terry Jan Reedy <tjreedy@udel.edu> | 2014-05-24 22:48:03 (GMT) |
|---|---|---|
| committer | Terry Jan Reedy <tjreedy@udel.edu> | 2014-05-24 22:48:03 (GMT) |
| commit | 62012fc719818b6087b01c93fcc1cd0d2b4d8932 (patch) | |
| tree | 5104802fce85d89b4f2d186d38ec0b579f486237 /Lib/idlelib/ScrolledList.py | |
| parent | d383bafa556de686be4898d6544ce998a0812532 (diff) | |
| download | cpython-62012fc719818b6087b01c93fcc1cd0d2b4d8932.zip cpython-62012fc719818b6087b01c93fcc1cd0d2b4d8932.tar.gz cpython-62012fc719818b6087b01c93fcc1cd0d2b4d8932.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.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/Lib/idlelib/ScrolledList.py b/Lib/idlelib/ScrolledList.py index 92119365..e235661 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) |
