Vitor Bosshard wrote:
> I have some objects on the canvas that can be dragged with
> the mouse. While dragging, each time OnMove (a method on my custom
> GUIMode) is called, it recalculates the position of the object,
> redraws it, and triggers a render request that is calculated on
> another thread 

How do you calculate it on another thread? Are you making any calls to 
wx functions/methods (other than CallAfter or PostEvenet)? from the 
other thread

In general, wx is not thread-safe, so that may be the source of your issue.

> It looks like my custom notifications are being swallowed by
> wx whenever floatcanvas is generating a large amount of updates.
> 
> The hack I found to work around this is to make the OnMove method
> immediately return if less than .1 secs have passed since the last
> call to it. This is the shortest time interval that fixes the problem
> reliably.

There is similar code in the EVT_SIZE handler -- if it takes longer to 
re-draw than the time between EVT_SIZE events, the display would get 
pretty flashy and clunky. However, aside form being slow and looking 
ugly, I don't remember anything actually  breaking.

> I just thought I'd let you know about this, I'm interested to hear of
> any better ways to handle this issue.

If you are making any wx calls in another thread, then that needs to be 
refactored. Otherwise, calls to wx.app.Yield inteh right place might help.

Can you duplicate it in a small, self contained sample?

-Chris



-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

[email protected]
_______________________________________________
FloatCanvas mailing list
[email protected]
http://mail.mithis.com/cgi-bin/mailman/listinfo/floatcanvas

Reply via email to