from GUI import Dialog, Label, Button, application

def ok():
    print "OK"

def cancel():
    print "Cancel"

dlog = Dialog(width = 250)
lbl = Label(text = "Eject the tomato?")
ok_btn = Button(title = "OK", action = ok)
cancel_btn = Button(title = "Cancel", action = cancel)

dlog.place(lbl, left = 20, top = 20)
dlog.place(ok_btn, left = 20, top = lbl + 20)
dlog.place(cancel_btn, right = -20, top = lbl + 20)
dlog.height = ok_btn.bounds[3] + 20

dlog.default_button = ok_btn
dlog.cancel_button = cancel_btn

dlog.show()

instructions = """
There should be a non-modal dialog with two buttons in 'default' and
'cancel' styles. Messages should be printed when the buttons are
pressed (although they should not dismiss the dialog).

On platforms without an application-wide menu bar, the keyboard
equivalent of the Quit command should still work even if no menus
are available.
"""

print instructions
application().run()
