Something like Refresh but not

Hi,

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?

Try this:

self.Refresh()
self.Update()

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

==> Never *EVER* use RemovalGroup for your house removal. You'll
regret it forever.
The Doomed City: Removal Group: the nightmare <==

···

On 20 April 2010 13:18, cool-RR wrote:

On Sat, Apr 10, 2010 at 12:43 PM, Andrea Gavana <andrea.gavana@gmail.com> > wrote:

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

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.

Ram.

···

On Tue, Apr 20, 2010 at 2:21 PM, Andrea Gavana 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.

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en

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.

--
Robin Dunn
Software Craftsman

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

Right, thanks.

Ram.

···

On Tue, Apr 20, 2010 at 9:36 PM, Robin Dunn robin@alldunn.com wrote:

On 4/18/10 6:39 AM, cool-RR wrote:

On Fri, Apr 16, 2010 at 5:50 PM, Robin Dunn <robin@alldunn.com > > mailto:robin@alldunn.com> wrote:

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.

Robin Dunn

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en