MCPcopy Index your code
hub / github.com/python/cpython / test

Function test

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

Source from the content-addressed store, hash-verified

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

Callers 1

simpledialog.pyFile · 0.70

Calls 4

TkClass · 0.90
ButtonClass · 0.90
packMethod · 0.45
mainloopMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…