def deactivate_cb(self, pobj, data):
     if xfl.fl_object_is_active(self.fd_mainform.folder):
         xfl.fl_set_object_label(pobj, "Activate")
         xfl.fl_deactivate_object(self.fd_mainform.folder)
     else:
         xfl.fl_set_object_label(pobj, "Deactivate")
         xfl.fl_activate_object(self.fd_mainform.folder)
 def setit(self, pobj, val):
     if val:
         xfl.fl_set_object_lcol(pobj, xfl.FL_BLACK)
         xfl.fl_activate_object(pobj)
     else:
         xfl.fl_set_object_lcol(pobj, xfl.FL_INACTIVE)
         xfl.fl_deactivate_object(pobj)
 def deactivate_cb(self, pobj, data):
     if xfl.fl_object_is_active(self.fd_scb.hor_thin):
         xfl.fl_set_object_label(self.fd_scb.deactivate, "Activate")
         xfl.fl_deactivate_object(self.fd_scb.hor_thin)
     else:
         xfl.fl_set_object_label(self.fd_scb.deactivate, "Deactivate")
         xfl.fl_activate_object(self.fd_scb.hor_thin)
def main(lsysargv, sysargv):
    xfl.fl_initialize(lsysargv, sysargv, "FormDemo", None, 0)
    pform = xfl.fl_bgn_form(xfl.FL_UP_BOX, 150, 300)

    psl1 = xfl.fl_add_slider(xfl.FL_VERT_SLIDER, 20, 20, 40, 180, "X")
    psl2 = xfl.fl_add_slider(xfl.FL_VERT_SLIDER, 90, 20, 40, 180, "1-X")
    xfl.fl_deactivate_object(psl2)
    pbut = xfl.fl_add_button(xfl.FL_NORMAL_BUTTON, 40, 250, 70, 30, "Exit")
    xfl.fl_set_object_callback(pbut, exitcb, 0)

    xfl.fl_end_form()

    xfl.fl_show_form(pform, xfl.FL_PLACE_CENTER, xfl.FL_NOBORDER, "Inactive Slider")

    while True:
        pobj = xfl.fl_do_forms()
        xfl.fl_set_slider_value(psl2, 1.0 - xfl.fl_get_slider_value(psl1))

    xfl.fl_hide_form(pform)
    xfl.fl_finish()

    return 0
Ejemplo n.º 5
0
 def disable_it(self, pobj, data):
     if xfl.fl_get_button(pobj):
         xfl.fl_deactivate_object(self.fd_canvasform.canvas)
     else:
         xfl.fl_activate_object(self.fd_canvasform.canvas)