Re: Can not intercept and disable MouseWheel on a canvas
- From: Lamprecht <ch.l.ngre-nospam@xxxxxxxxx>
- Date: Thu, 22 Apr 2010 09:06:02 +0200
Mumia W. wrote:
On 04/21/2010 04:59 PM, Lamprecht wrote:Mumia W. wrote:
None of these methods, and a dozen others I tried, work to disableHi Mumia,
mouse-wheel scrolling for canvas widgets. How do I do this? I'm using
Debian 5.0, Perl 5.10.0 and Perl-tk 804.028.
check <Button-4> and <Button-5> event handlers,
(<MouseWheel> is a Windows thing).
Christoph
Thanks, that sort of works. I can intercept mouse wheel events, but I still can't disable the scrolling. I tried this:
$canvas->CanvasBind('<Button-4>', '');
$canvas->CanvasBind('<Button-5>', '');
However, I still get scrolling. Can I disable that?
It seems to be the Window manager, that does this.
You can force an yview reset:
$canvas->CanvasBind("<$_>", sub {
$canvas->yviewMoveto( 0 )})for (4,5);
Or set up a negative scollbinding (possibly needs adjustment of the number):
$canvas->CanvasBind("<4>", sub {
$canvas->yviewScroll( 1,'units' )});
$canvas->CanvasBind("<5>", sub {
$canvas->yviewScroll( -1,'units' )});
Cheers, Christoph
--
Tk::EntrySet
display/edit a list of values in a Set of Widgets.
Tk::ChoicesSet
display/edit a list of choices in a Set of single-selection Widgets.
.
- Follow-Ups:
- Re: Can not intercept and disable MouseWheel on a canvas
- From: Mumia W.
- Re: Can not intercept and disable MouseWheel on a canvas
- References:
- Re: Can not intercept and disable MouseWheel on a canvas
- From: Lamprecht
- Re: Can not intercept and disable MouseWheel on a canvas
- From: Mumia W.
- Re: Can not intercept and disable MouseWheel on a canvas
- Prev by Date: Re: Help printing contents of Checkbutton HASH
- Next by Date: Re: Help printing contents of Checkbutton HASH
- Previous by thread: Re: Can not intercept and disable MouseWheel on a canvas
- Next by thread: Re: Can not intercept and disable MouseWheel on a canvas
- Index(es):
Relevant Pages
|