1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
import locale from dialog import Dialog
locale.setlocale(locale.LC_ALL, '')
d = Dialog(dialog="dialog")
d.set_background_title("My little program")
if d.yesno("Are you REALLY sure you want to see this?") == d.DIALOG_OK: d.msgbox("You have been warned...")
code, tags = d.checklist("What sandwich toppings do you like?", choices=[("Catsup", "", False), ("Mustard", "", False), ("Pesto", "", False), ("Mayonnaise", "", True), ("Horse radish","", True), ("Sun-dried tomatoes", "", True)], title="Do you prefer ham or spam?", backtitle="And now, for something " "completely different...") if code == d.DIALOG_OK: pass else: code, tag = d.menu("OK, then you have two options:", choices=[("(1)", "Leave this fascinating example"), ("(2)", "Leave this fascinating example")]) if code == d.DIALOG_OK: pass
|