For Programmers: Free Programming Magazines  


Home > Archive > PerlTk > May 2005 > Lock canvas/photo into place?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Lock canvas/photo into place?
woodenbicycle@hotmail.com

2005-05-09, 3:58 pm

Hello, to add to my other post asking about capturing / binding the
mouse scroll wheel on a global level, I have another related question.
This one has been more of a problem, one I have not yet been able to
work around.

In my little project are a few photos. These are JPEG images on a same
sized canvas placed via Photo and createImage. The photos appear just
fine, but if the cursor is over one of these photos, moving the scroll
wheel will cause the photo to scroll right off of its canvas! Also, if
I press the TAB key until one of the photos is selected, using the
arrow keys will also cause the photo to scroll off of its canvas!

How can I disable this behavior? I want the photos to stay locked in
place.

Thank you.

Pepper

Jack D

2005-05-09, 8:57 pm


<woodenbicycle@hotmail.com> wrote in message
news:1115654415.674303.286250@f14g2000cwb.googlegroups.com...
> Hello, to add to my other post asking about capturing / binding the
> mouse scroll wheel on a global level, I have another related question.
> This one has been more of a problem, one I have not yet been able to
> work around.
>
> In my little project are a few photos. These are JPEG images on a same
> sized canvas placed via Photo and createImage. The photos appear just
> fine, but if the cursor is over one of these photos, moving the scroll
> wheel will cause the photo to scroll right off of its canvas! Also, if
> I press the TAB key until one of the photos is selected, using the
> arrow keys will also cause the photo to scroll off of its canvas!
>
> How can I disable this behavior? I want the photos to stay locked in
> place.


Try setting -scrollregion. (documented in Tk::Canvas)

Jack


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com