Hi Andrea,
In your code, I fixed L103 as follows:
- wx.CallAfter(self.DoLongRunningTask, i)
+ self.DoLongRunningTask(i)
Then, everything works fine.
I’m using wxPython 4.2.1, Python 3.11.4.
The matplotlib version should be 3.7.2 ~ 3.8.0/WXAgg recently released, where a wx-event-related bug fix has been applied: https://github.com/matplotlib/matplotlib/pull/25559.