wasm-demo/demo/ermis-f/python_m/cur/0109

43 lines
1.4 KiB
Plaintext

From: fredrik at pythonware.com (Fredrik Lundh)
Date: Tue, 20 Apr 1999 09:53:46 GMT
Subject: Tkinter Canvas & Fast Scrolling/Dragging
References: <19990416174016.A1559856@vislab.epa.gov>
Message-ID: <00b301be8b13$b0e35300$f29b12c2@pythonware.com>
Content-Length: 1079
X-UID: 109
Randall Hopper <aa8vb at vislab.epa.gov> wrote:
> Basically, what I want to do is turn off filling of canvas objects
> temporarily while the user is scrolling the canvas or they're dragging one
> of the shapes. When the operation is finished (user releases the mouse),
> I'll turn fill back on.
>
> The idea here being that the canvas seems to be pretty responsive for me
> until it has to draw stipple shapes. Then it's painfully slow.
>
> I know how to do this for dragging, but I don't know where to "hook in" for
> scrolling.
I think the best way is to add bindings to the scrollbar(s).
something like:
scrollbar.bind("<Button-1>", my_canvas.no_detail)
scrollbar.bind("<ButtonRelease-1>", my_canvas.full_detail)
might do the trick.
another solution would be to hook into the scrollbar interface; see
http://www.dejanews.com/getdoc.xp?AN=464786051
for some details.
but that only allows you to figure out when to switch to less
detail... you could perhaps switch back after a short timeout,
or when the user moves the mouse back into the canvas.
</F>