def done_cb(self, pobj, data): if xfl.fl_show_question("Do you want to quit ?", 0): print("will quit after 5 seconds\n") xfl.fl_msleep(5000) xfl.fl_hide_form(pobj.contents.form) xfl.fl_free_form(pobj.contents.form) xfl.fl_finish() sys.exit(0) else: return 0
def __init__(self, lsysarg, sysargv): xfl.fl_initialize(lsysarg, sysargv, "FormDemo", None, 0) fdnew = self.create_form() xfl.fl_clear_browser(self.pbr) xfl.fl_add_browser_line(self.pbr, "LOAD A FILE.") xfl.fl_set_browser_fontstyle(self.pbr, xfl.FL_FIXED_STYLE) xfl.fl_show_form(fdnew, xfl.FL_PLACE_FREE, xfl.FL_FULLBORDER, \ "Browser") poret = xfl.fl_do_forms() if poret.contents.label: prndata = poret.contents.label else: prndata = "" message = "%p %d %s\n" % (poret.contents, poret.contents.objclass, prndata) print(message) xfl.fl_hide_form(fdnew) xfl.fl_free_form(fdnew) xfl.fl_finish()