I have been - corectly informed that a program I have written has a
major memory leak. I think I have figured out why - everytime I update I
need to change the color of a drawn object. Instead I am overwriting the
display.
What I need to do is change my draw a hex code so that each hex can
later be referenced, and then change the shapes color.
Here are the chunks of code that are relavent to what I am working on.
def makehex(self,x,y):
global colorarray,colormap
plotx = x * 18
ploty = y * 24
if x%2 == 0:
ploty = ploty + 12
self.MyAddShape(HexShape(36, 36), plotx, ploty,
wxPen(wxColour(90,90,90), 2, wxDOT),colorarray[colormap[x][y]],"")
class HexShape(wxPolygonShape):
def __init__(self, w=0.0, h=0.0):
wxPolygonShape.__init__(self)
if w == 0.0:
w = 24.0
if h == 0.0:
h = 24.0
points = [ (12,6,),
(6,18),
(12,30),
(24,30),
(30,18),
(24,6),
]
self.Create(points)