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
|
|
@ -76,14 +76,21 @@ class ListboxToolTip(ToolTipBase):
|
|||
for item in self.items:
|
||||
listbox.insert(END, item)
|
||||
|
||||
def main():
|
||||
# Test code
|
||||
def _tooltip(parent):
|
||||
root = Tk()
|
||||
b = Button(root, text="Hello", command=root.destroy)
|
||||
b.pack()
|
||||
root.update()
|
||||
tip = ListboxToolTip(b, ["Hello", "world"])
|
||||
root.title("Test tooltip")
|
||||
width, height, x, y = list(map(int, re.split('[x+]', parent.geometry())))
|
||||
root.geometry("+%d+%d"%(x, y + 150))
|
||||
label = Label(root, text="Place your mouse over buttons")
|
||||
label.pack()
|
||||
button1 = Button(root, text="Button 1")
|
||||
button2 = Button(root, text="Button 2")
|
||||
button1.pack()
|
||||
button2.pack()
|
||||
ToolTip(button1, "This is calltip text for button1.")
|
||||
ListboxToolTip(button2, ["This is","calltip text","for button2"])
|
||||
root.mainloop()
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
from idlelib.idle_test.htest import run
|
||||
run(_tooltip)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue