Hi everyone,

I'm new to wxpython, so I apologize in advance if this has a simple solution. The GUI I'm working on has the following basic structure:

def function(time) -> initialized from frame and generates data needed in panel

class panel -> displays data and images generated in function

class frame -> wraps around panel and contains toolbar buttons that advance the time variable and rerun function

The problem I'm running into is that while the toolbar buttons are updating the function output, the panel is not updating with the new data. How do I update variables in the panel with new data generated by toolbar buttons in the frame? I'll post my code if anyone needs it, but it's kind of long.

Thank you!

9 Years
Discussion Span
Last Post by Das246

You may need to write functions that specifically update lists or append text to text controls, then call these from the event functions.

If the problem is that the GUI is locking while your timer function does its work then this is more complicated and will need threading with wx.CallAfter() events. I can give examples of both these methods if it is helpful.

Good luck :)


Thanks for your response! I was finally able to get the panels to update by having the frame call the panels with GetChildren() and then using SetLabel() for the text parts. It doesn't work on the images though. Is there a SetLabel() equivalent for changing StaticBitmap code?


You could call a .Refresh() on the window which will repaint the window.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.