Hi,
<snip>
(Refresh/OnPaint rely on the wxWidgets event system and ultimately to
the platform, which will decide if and when the window is "damaged"
and requires a repainting).
Is there any way to force a refresh? I mean, cause the `on_paint` to be
called regardless of what the OS considers dirty?
Tried it now, didn’t work. I have a pane in PyAUI on Ubuntu, and it’s getting redrawn only when I resize the window. I am trying to call Refresh and Update on it, but it won’t get redrawn.
Is it not redrawing or is it not recalculating the layout of child widgets? (I ask because some people seem to confuse these two things.)
···
On 4/20/10 5:31 AM, cool-RR wrote:
On Tue, Apr 20, 2010 at 2:21 PM, Andrea Gavana <andrea.gavana@gmail.com > <mailto:andrea.gavana@gmail.com>> wrote:
> Is there any way to force a refresh? I mean, cause the `on_paint`
to be
> called regardless of what the OS considers dirty?
Try this:
self.Refresh()
self.Update()
Andrea.
Tried it now, didn't work. I have a pane in PyAUI on Ubuntu, and it's
getting redrawn only when I resize the window. I am trying to call
`Refresh` and `Update` on it, but it won't get redrawn.
On 4/16/10 4:23 AM, cool-RR wrote:
Is there a way to have some action run after every iteration of
wxPython's event loop? I think this would solve this problem,
and would
be very helpful in some other problems.
I think the closest thing we have to that is to override FilterEvent
in your derived wx.App class. As it's name implies it is intended
to use for filtering events, so it is actually called before each
event is processed, but it should give you what you want. Just be
sure to return -1 so the events will be processed normally. You'll
also need to call SetCallFilterEvent(True) to turn on calls to your
FilterEvent method.
--
Robin Dunn
So this will get called for every event being processed?
Yes.
Won’t this slow
everything up?
Perhaps (that is why you have to call a method to explicitly turn it on) but probably about the same as implementing your own MainLoop would.
Also, how do I hack this into something that gets called
once after every iteration of the loop?
Derive a class from wx.App. Give it a FilterEvent method. Do whatever you need from there. Return -1.