I have a custom drawn control, which is a descendant of wx.Panel that animates. There’s a timer which pulses at set intervals to prompt controls like this to do some painting.
I’ve noticed that this happens when the whole app is hidden / minimized or just if the panel that the control is placed on is hidden.
What would be the best approach to only animate the control when it’s visible, or at least not hidden?
Also, if there’s a more elegant way of achieving this I’d also be interested
Periodically check self.IsShownOnScreen(), and start/stop your timer accordingly.
···
On 11/14/12 6:45 AM, Paul Wiseman wrote:
I have a custom drawn control, which is a descendant of wx.Panel that
animates. There's a timer which pulses at set intervals to prompt
controls like this to do some painting.
I've noticed that this happens when the whole app is hidden
/ minimized or just if the panel that the control is placed on is hidden.
What would be the best approach to only animate the control when
it's visible, or at least not hidden?