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

master
kliment 2011-07-04 11:45:17 +02:00
parent 72c68030cc
commit 51f59b0618
2 changed files with 5 additions and 2 deletions

View File

@ -61,8 +61,10 @@ class gviz(wx.Panel):
self.layerindex=0
self.showall=0
self.dirty=1
self.blitmap=wx.EmptyBitmap(self.GetClientSize()[0],self.GetClientSize()[1],-1)
self.repaint()
def layerup(self):
if(self.layerindex+1<len(self.layers)):
self.layerindex+=1
@ -173,7 +175,8 @@ class gviz(wx.Panel):
if __name__ == '__main__':
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()
app.MainLoop()

View File

@ -642,7 +642,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
return
path = os.path.split(name)[0]
if path != self.settings.last_file_path:
self.set("last_file_path",path)
self.set("last_file_path",path)
if name.lower().endswith(".stl"):
self.skein(name)
else: