wxpython — threads and window events

后端 未结 2 1209
长发绾君心
长发绾君心 2021-01-03 05:56

I have a wxPython application (http://www.OpenSTV.org) that counts ballots using methods that have multiple rounds. I\'d like to do two things:

(1) For a large numb

2条回答
  •  天命终不由人
    2021-01-03 06:31

    There are several ways to call the main thread wxPython thread from a process thread. The simplest is wx.CallAfter() which will always execute the functional passed to it in the main thread. You can also use wx.PostEvent() and there's an example of this in the demo (labeled: Threads), and there are several more complicated but more customizable ways which are discussed in the last chapter of wxPython in Action.

提交回复
热议问题