From df81a73dcc2b1771c31c2032079b17dc984c3b3f Mon Sep 17 00:00:00 2001 From: Keegi Date: Fri, 5 Aug 2011 01:32:22 +0300 Subject: [PATCH] use enable/disable for pause button instead of hide/show to not interfere with custombuttons --- pronterface.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pronterface.py b/pronterface.py index 7d85105..5a04b08 100755 --- a/pronterface.py +++ b/pronterface.py @@ -131,7 +131,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole): def endcb(self): print "Print took "+str(int(time.time()-self.starttime)/60)+" minutes." - wx.CallAfter(self.pausebtn.Hide) + wx.CallAfter(self.pausebtn.Disable) wx.CallAfter(self.printbtn.SetLabel,"Print") @@ -524,7 +524,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole): self.topsizer.Fit(self) # disable all printer controls until we connect to a printer - self.pausebtn.Hide() + self.pausebtn.Disable() for i in self.printerControls: i.Disable() @@ -934,7 +934,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole): wx.CallAfter(self.printbtn.Enable) wx.CallAfter(self.status.SetStatusText,"Loaded "+self.filename+", %d lines"%(len(self.f),)) - wx.CallAfter(self.pausebtn.Hide) + wx.CallAfter(self.pausebtn.Disable) wx.CallAfter(self.printbtn.SetLabel,"Print") threading.Thread(target=self.loadviz).start() @@ -981,7 +981,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole): self.status.SetStatusText("Loaded "+name+", %d lines"%(len(self.f),)) wx.CallAfter(self.printbtn.SetLabel, "Print") wx.CallAfter(self.pausebtn.SetLabel, "Pause") - wx.CallAfter(self.pausebtn.Hide) + wx.CallAfter(self.pausebtn.Disable) if self.p.online: wx.CallAfter(self.printbtn.Enable) threading.Thread(target=self.loadviz).start() @@ -1016,7 +1016,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole): def on_startprint(self): wx.CallAfter(self.pausebtn.SetLabel, "Pause") - wx.CallAfter(self.pausebtn.Show) + wx.CallAfter(self.pausebtn.Enable) wx.CallAfter(self.printbtn.SetLabel, "Restart") def endupload(self): @@ -1107,7 +1107,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole): wx.CallAfter(self.connectbtn.Enable); wx.CallAfter(self.printbtn.Disable); - wx.CallAfter(self.pausebtn.Hide); + wx.CallAfter(self.pausebtn.Disable); for i in self.printerControls: wx.CallAfter(i.Disable)