Brennan Vincent
Brennan Vincent

Reputation: 10666

Run function on WxPython GUI thread

part-time C# programmer here trying to learn Python.

I am looking to be able to, from another thread, set up a function that will be run on the GUI thread in WxPython. Currently the only way I can think of doing this is to push the function onto some cross-thread-synchronized list, then have a timer firing every few milliseconds (on the GUI thread) that checks the list and runs any functions that have been pushed onto it. I was wondering if there was instead a more canonical way of doing this, similar to BeginInvoke in .NET.

Upvotes: 1

Views: 768

Answers (1)

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 798466

wx.CallLater and wx.CallAfter().

Upvotes: 5

Related Questions