from GUI import Window, CheckBox, application

def report():
  print "Check box set to", box.on
 
def change_auto_toggle():
    box.auto_toggle = auto.on

box = CheckBox(x = 20, y = 20,
    title = "Check Box", action = report)

auto = CheckBox(x = 20, y = box.bottom + 10,
    title = "Auto Toggle",
    action = change_auto_toggle,
    on = 1)

win = Window(width = 200, height = auto.bottom + 20,
    title = "Check Boxes")

win.add(box)
win.add(auto)
win.show()

instructions = """
There should be two check boxes titled "Check Box" and "Auto Toggle".
Clicking in the top check box should cause its state to be reported.
Clicking in the bottom check box should turn auto-toggling behaviour
of the top check box on and off.
"""

print instructions

application().run()
