MCPcopy Index your code
hub / github.com/RustPython/RustPython / test

Function test

Lib/tkinter/simpledialog.py:417–439  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

415if __name__ == '__main__':
416
417 def test():
418 root = Tk()
419 def doit(root=root):
420 d = SimpleDialog(root,
421 text="This is a test dialog. "
422 "Would this have been an actual dialog, "
423 "the buttons below would have been glowing "
424 "in soft pink light.\n"
425 "Do you believe this?",
426 buttons=["Yes", "No", "Cancel"],
427 default=0,
428 cancel=2,
429 title="Test Dialog")
430 print(d.go())
431 print(askinteger("Spam", "Egg count", initialvalue=12*12))
432 print(askfloat("Spam", "Egg weight\n(in tons)", minvalue=1,
433 maxvalue=100))
434 print(askstring("Spam", "Egg label"))
435 t = Button(root, text='Test', command=doit)
436 t.pack()
437 q = Button(root, text='Quit', command=t.quit)
438 q.pack()
439 t.mainloop()
440
441 test()

Callers 1

simpledialog.pyFile · 0.70

Calls 4

TkClass · 0.85
ButtonClass · 0.70
packMethod · 0.45
mainloopMethod · 0.45

Tested by

no test coverage detected