Aug-08-2018, 08:47 PM
(This post was last modified: Aug-08-2018, 09:01 PM by Gribouillis.)
It seems to me that your thread's main action is the
self.run()
and that this call does not use the wxpython GUI (tell me if I'm wrong). This main task of the thread must not go under anythread
. The decorator is used to wrap parts that update the GUI. You could perhaps cut this indef button_run(self, event): ''' @brief Call to run KiCost.''' event.Skip() self.run_kicost_guide() @anythread def foo(self): self.m_gauge_process.SetValue(0) self.m_button_run.Disable() self.save_properties() # Save the current graphical configuration before call the KiCost motor. logger.log(DEBUG_OVERVIEW, 'Starting the KiCost scrape process.') def run_kicost_guide(self): '''Run the as a Thread out of the box wxPython''' self.foo() self.run() # Run KiCost. self.bar() @anythread def bar(self): init_distributor_dict() # Restore distributors removed during the execution of KiCost motor. self.m_button_run.Enable()