def __init__(self, parent): DraggableBox.__init__(self, parent) # params for the layout self._linelen = 40 self._xoffset = 10 self._yoffset = 3 self._yspacing = 16 # position in upper left by default self.position = 10, 10 self.bgcolor = 'w' # start with nothing self._stringList = [] self.visible = False # by creating a _wobjects attribute, we are allowed to hold # wobjects, but our ourselves responsible for drawing them self._wobjects = []
def OnDraw(self): # draw box DraggableBox.OnDraw(self) # draw lines for line in self._wobjects: line.OnDraw() # reset some stuff that was set because it was thinking it was drawing # in world coordinates. gl.glDisable(gl.GL_DEPTH_TEST)
def OnDestroy(self): DraggableBox.OnDestroy(self) # clear lines and such for ob in [ob for ob in self._wobjects]: ob.Destroy()