mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
Issue #21477: Idle htest: merge and modify run and runall; add many tests.
Patch by Saimadhav Heblikar
This commit is contained in:
parent
10cbb1e463
commit
1b392ffe67
18 changed files with 412 additions and 179 deletions
|
|
@ -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)
|
||||
for i in range(30):
|
||||
s.append("item %02d" % i)
|
||||
return root
|
||||
|
||||
def main():
|
||||
root = test()
|
||||
scrolled_list = MyScrolledList(root)
|
||||
for i in range(30):
|
||||
scrolled_list.append("Item %02d" % i)
|
||||
|
||||
root.mainloop()
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
from idlelib.idle_test.htest import run
|
||||
run(_scrolled_list)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue