Aug-07-2018, 03:47 PM
I am one of the developer of a python2/3 package available on https://github.com/hildogjr/KiCost/
I am developing a GUI on wxPython 4.0.3 to call the CLI program part (
The call is made by a thread the execute the CLI function
I am developing a GUI on wxPython 4.0.3 to call the CLI program part (
kicost/kicost_gui.py
file).The call is made by a thread the execute the CLI function
kicost(foo)
inside the run(self)
, but in the thread have to update some GUI controls (process bars, text infos, log...). The GUI change parameters (text, label, process perceptual) work fine (or was before some changes on me code and update from wxPy4.0.1 to 4.0.3), now is returning this error:Error:[xcb] Unknown sequence number while processing queue
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
python3: ../../src/xcb_io.c:274: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.
Aborted (core dumped)
I think that is a bad configuration and call of the threading as I coded (bellow). Someone have some tips?def button_run(self, event): ''' @brief Call to run KiCost.''' event.Skip() def run_kicost_guide(): '''Run the as a Thread out of the box wxPython''' 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.') self.run() # Run KiCost. init_distributor_dict() # Restore distributors removed during the execution of KiCost motor. self.m_button_run.Enable() def run_kicost_guide_action(): # Necessary to not freeze the GUI application during the scrapes. kicost_motor_thread = threading.Thread(target=run_kicost_guide) #kicost_motor_thread.setDaemon(1) kicost_motor_thread.start() wx.CallLater(10, run_kicost_guide_action) # Necessary to not '(core dumped)' with wxPython.