Commit 51f59b06 authored by kliment's avatar kliment

Fix crash on new gcode file load if no previous file was loaded

parent 72c68030
...@@ -61,8 +61,10 @@ class gviz(wx.Panel): ...@@ -61,8 +61,10 @@ class gviz(wx.Panel):
self.layerindex=0 self.layerindex=0
self.showall=0 self.showall=0
self.dirty=1 self.dirty=1
self.blitmap=wx.EmptyBitmap(self.GetClientSize()[0],self.GetClientSize()[1],-1)
self.repaint() self.repaint()
def layerup(self): def layerup(self):
if(self.layerindex+1<len(self.layers)): if(self.layerindex+1<len(self.layers)):
self.layerindex+=1 self.layerindex+=1
...@@ -173,7 +175,8 @@ class gviz(wx.Panel): ...@@ -173,7 +175,8 @@ class gviz(wx.Panel):
if __name__ == '__main__': if __name__ == '__main__':
app = wx.App(False) app = wx.App(False)
main = window(open("/home/kliment/designs/spinner/gearend_export.gcode")) #main = window(open("/home/kliment/designs/spinner/gearend_export.gcode"))
main = window(open("jam.gcode"))
main.Show() main.Show()
app.MainLoop() app.MainLoop()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment