def post_handler(self, pobj, event, mx, my, key, xev): if not pobj.contents.u_cdata: return 0 if event == xfl.FL_ENTER: self.timeoutID = xfl.fl_add_timeout(self.INTERVAL, \ self.do_tips, pobj) elif event == xfl.FL_LEAVE or event == xfl.FL_PUSH: xfl.fl_hide_oneliner() if self.timeoutID: xfl.fl_remove_timeout(self.timeoutID) self.timeoutID = 0 return 0
def post(pobj, ev, mx, my, key, pxev): if ev == xfl.FL_PUSH or ev == xfl.FL_MOTION: wx, wy = xfl.fl_xyplot_s2w(pobj, mx, my) buf = "x=%d y=%d wx=%.1f wy=%.1f" % (mx, my, wx, wy) xfl.fl_show_oneliner(buf, pobj.contents.x + \ pobj.contents.form.contents.x + 5, pobj.contents.y + \ pobj.contents.form.contents.y) # xfl.fl_object_ps_dump(pobj, "test.ps") pobj.contents.wantkey = xfl.FL_KEY_ALL pobj.contents.input = 1 elif ev == xfl.FL_RELEASE: xfl.fl_hide_oneliner() elif ev == xfl.FL_KEYPRESS: keytxt = "key=%d\n" % key print(keytxt) return 0