Home > Archive > PerlTk > March 2007 > Canvas Widget
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]
|
|
| nagandla@gmail.com 2007-03-14, 7:07 pm |
| Hi all,
I am creating a canvas widget and in that canvas i am
playing .mpg file.....
here is a sample code..
$prev_canvas = $preview_page->Canvas(-bg => 'white',-confine => '0')-
>pack(-fill => 'both',
-expand => '1');
$ENV{SDL_WINDOWID} = $prev_canvas->id;
here i am catching the id f canvas and from that i am playing .mpg
file....
now my problem is while scrolling a mouse middle button the mpeg is
disabling with that canvas....
how to solve that problem..... for that i write the code as...
$prev_canvas->CanvasBind("<Button-2>", sub { $prev_canvas->focus; });
but its not working....
how can i do that....please help me
Regards
Lakshmi Nagandla
| |
|
| <nagandla@gmail.com> wrote in message
news:1173881276.600161.191110@p15g2000hsd.googlegroups.com...
> Hi all,
>
> I am creating a canvas widget and in that canvas i am
> playing .mpg file.....
> here is a sample code..
>
> $prev_canvas = $preview_page->Canvas(-bg => 'white',-confine => '0')-
> -expand => '1');
>
> $ENV{SDL_WINDOWID} = $prev_canvas->id;
> here i am catching the id f canvas and from that i am playing .mpg
> file....
> now my problem is while scrolling a mouse middle button the mpeg is
> disabling with that canvas....
>
> how to solve that problem..... for that i write the code as...
>
> $prev_canvas->CanvasBind("<Button-2>", sub { $prev_canvas->focus; });
>
> but its not working....
>
I'm not really sure on what you mean - but Button-2 is a "click" (i.e.
ButtonPress) not a scroll. Assuming you have a scrollwheel and depending on
your platform, the event you want to bind to could be '<MouseWheel>'
(windows) or perhaps '<Button-4>' and '<Button-5>' (linux et al)
http://www.oreilly.com/catalog/mast...apter/ch15.html
Search for "sub BindMouseWheel"
Jack
| |
|
|
|
|
|