Christoffer Sørensen wrote:
> I want to know if it is possible for floatcanvas to implement a fluent
> way of updating the canvas while you are using the hand tool? That is,
> it should update constantly while you drag the canvas around.

If you're drawing isn't too complicated, then it should be doable.

I tend to have drawings that take a while to update, so it would get 
really jerky if you had it update as you moved.

I suppose the best way to handle it would be to use a system like that 
used to handle EVT_SIZE. What that does is set a timer when there is a 
size event, and only draws when the timer goes off. That way it only 
draws when the user slows down, rather than trying to draw it 100 time 
while the user is re-sizing the window.

Anyway, of you want to play with it, the relevant code is in:

floatcanvas/GUIMode.py

class GUIMove()

OnMove() and MoveImage() methods.

You'll see that there is a lot of code to get it to draw just what is 
still visible of the existing buffer. You should be able to replace all 
that with a call to:

self.Canvas.MoveImage(DiffMove, 'Pixel')

(see the OnLeftUp method)

Let us know how it works out. If it works OK, perhaps we could have a 
flag to set, so the user can choose which way s/he'd like it to work for 
a given application.

By the way, what are you using it for? I like to know.

Also, be aware that we are in the midst of a Google Summer of Code 
project to re-factor FloatCanvas. We're having some of the discussion on 
this list, so please feel free to take part.

-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