Пример #1
0
 def main_callback(self, pxev, pvdata):
     ldata = xfl.fls_convert_ptrvoid_to_ptrlongc(pvdata).contents.value
     xfl.fl_winset(self.main_win)
     if pxev.contents.type == xfl.Expose:
         self.redrawit()
     elif pxev.contents.type == xfl.ButtonPress:
         self.drawobject()
     return 0
Пример #2
0
 def drawit(self, stobj):
     xfl.fl_winset(self.main_win)
     xfl.fl_mapcolor(xfl.FL_FREE_COL1, stobj.r, \
                 stobj.g, stobj.b)
     if stobj.type == 1:
         xfl.fl_rectf(stobj.x - stobj.size, \
                 stobj.y - stobj.size, 2 * stobj.size, \
                 2 * stobj.size, xfl.FL_FREE_COL1)
     elif stobj.type == 2:
         xfl.fl_circf(stobj.x, stobj.y, stobj.size, \
                 xfl.FL_FREE_COL1)
     elif stobj.type == 3:
         mylistpoint = [ \
                 {'x':int(stobj.x - stobj.size), \
                 'y':int(stobj.y + stobj.size)}, \
                 {'x':int(stobj.x + stobj.size), \
                 'y':int(stobj.y + stobj.size)}, \
                 {'x':int(stobj.x), \
                 'y':int(stobj.y - stobj.size)}]
         pxpoint = xfl.fls_make_ptr_flpoint(mylistpoint)
         xfl.fl_polyf(pxpoint, 3, xfl.FL_FREE_COL1)