def start_timer(self, pobj, data): self.fdform0.ldata += 200.0 numldata = self.fdform0.ldata / 1000 buf = "Timer accuracy testing %.3f sec ..." % numldata xfl.fl_set_object_label(self.fdform0.report, buf) self.start_sec, self.start_usec = xfl.fl_gettime() xfl.fl_set_timer(self.fdform0.timer, numldata)
def __init__(self, lsysargv, sysargv): self.TIME = 5 xfl.fl_initialize(lsysargv, sysargv, "FormDemo", None, 0) self.makeforms() xfl.fl_show_form(self.pform1, xfl.FL_PLACE_CENTER, \ xfl.FL_NOBORDER, "Timer") xfl.fl_set_timer(self.ptim, self.TIME) xfl.fl_do_forms()
def __init__(self, lsysargv, sysargv): self.T = 20 xfl.fl_set_border_width(-2) xfl.fl_initialize(lsysargv, sysargv, "FormDemo", None, 0) self.fd_timerform = self.create_form_timerform() # fill-in form initialization code xfl.fl_set_timer(self.fd_timerform.timer, self.T) xfl.fl_set_button(self.fd_timerform.down, 1) # show the first form xfl.fl_show_form(self.fd_timerform.timerform, xfl.FL_PLACE_CENTER, xfl.FL_FULLBORDER, "timerform") xfl.fl_do_forms()
def expired(self, pobj, data): if xfl.fl_show_question("Expired!\n\nQuit?", 0) == 1: xfl.fl_finish() sys.exit(0) else: xfl.fl_set_timer(self.fd_timerform.timer, self.T)
def reset(self, pobj, data): xfl.fl_set_timer(self.fd_timerform.timer, self.T)
def __init__(self, lsysargv, sysargv): self.pform = self.pexitob = self.pbtypeob = self.pmodeob = None c = xfl.FL_BLACK # char **p; # VN_struct *vn; # VN_struct *g = gmode, # *gs = g + sizeof gmode / sizeof *gmode; xfl.fl_initialize(lsysargv, sysargv, "FormDemo", None, 0) self.create_form() sorceress_width, sorceress_height, sorceress_bits = xfl.fls_import_xbmdata_from_file("srs.xbm") xfl.fl_set_bitmap_data(tobj[2], sorceress_width, sorceress_height, sorceress_bits) xfl.fl_add_chart_value(tobj[3], 15, "Item 1", c) c += 1 xfl.fl_add_chart_value(tobj[3], 5, "Item 2", c) c += 1 xfl.fl_add_chart_value(tobj[3], -10, "Item 3", c) c += 1 xfl.fl_add_chart_value(tobj[3], 25, "Item 4", c) c += 1 xfl.fl_add_nmenu_items(tobj[14], "Item 1|Item 2|Item 3|Item 4|item 5") xfl.fl_add_select_items(tobj[15], "Item 1") xfl.fl_add_select_items(tobj[15], "Item 2") xfl.fl_add_select_items(tobj[15], "Item 3") xfl.fl_add_select_items(tobj[15], "Item 4") xfl.fl_add_select_items(tobj[15], "Item 5") xfl.fl_set_timer(tobj[16], 1000.0) # for ( p = browserlines; *p; p++ ) for p in browserlines: xfl.fl_add_browser_line(tobj[17], p) # for ( vn = btypes; vn->val >= 0; vn++ ) for vn in btypes: xfl.fl_add_select_items(self.pbtypeob, vn["name"]) # for ( i = 1; g < gs; g++, i++ ) for g in range(0, len(gmode)): pitem = xfl.fl_add_select_items(self.pmodeob, gmode[g]["name"]) if not xfl.fl_mode_capable(gmode[g]["val"], 0): xfl.fl_popup_entry_set_state(pitem, xfl.FL_POPUP_DISABLED) # xfl.fl_vmode not working?? xfl.fl_set_select_item( self.pmodeob, xfl.fl_get_select_item_by_value(self.pmodeob, xfl.fl_get_vclass()) ) # 5 xfl.fl_get_vclass())) #xfl.fl_vmode.value)) xfl.fl_set_select_item(self.pbtypeob, xfl.fl_get_select_item_by_value(self.pbtypeob, 1)) self.boxtype_cb(self.pbtypeob, 0) xfl.fl_show_form(self.pform, xfl.FL_PLACE_MOUSE, border, "Box types") while True: if xfl.fl_is_same_object(xfl.fl_do_forms(), self.pexitob): break xfl.fl_finish()
def continue_cb(self, pobj, q): xfl.fl_hide_form(self.pform2) xfl.fl_activate_form(self.pform1) xfl.fl_set_timer(self.ptim, self.TIME) xfl.fl_set_object_callback(self.ptim, self.nothing, 0)
def timer1_expired(self, pobj, q): xfl.fl_deactivate_form(self.pform1) xfl.fl_set_timer(self.ptim2, 10) xfl.fl_show_form(self.pform2, xfl.FL_PLACE_MOUSE, \ xfl.FL_TRANSIENT, "Q")