def __init__(self, points, color, style='squares'): if style not in ('squares', 'diamonds'): raise ValueError('"%s" is not a valid style' % style) self._points = tuple(points) self._color = getColor(color) self._style = style self._graphicsContext = None
def _createGraphicsContexts(self): """ Creates the graphics contexts used by this class. This is not possible until the widget has been realized. """ self._foregroundGC = self.window.new_gc() self._backgroundGC = self.window.new_gc() self._backgroundGC.foreground = getColor('white')
def __init__(self, function, color, drawOnFrame=True): self._function = function self._color = getColor(color) self._drawOnFrame = drawOnFrame self._graphicsContext = None
def set_color(): color = widgets.getColor(PF.get('stl_color','green')) if color: PF['stl_color'] = colors.GLColor(color)