Thread Scrolled - Canvas mit Mausrad scrollen - nicht ? (18 answers)
Opened by Gast at 2007-09-07 14:23

renee
 2007-09-12 12:09
#99368 #99368
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/perl

use warnings;
use strict;
use Tk;

my $mw = MainWindow->new;

my $c = $mw->Scrolled(
        qw/Canvas -width 400 -height 400 -relief sunken
        -bg white -borderwidth 1 -scrollbars se -scrollregion/ => 
                [qw/0 0 1000 1000/])->pack;
                
$mw->bind($mw, '<MouseWheel>', 
        [sub { my $unit = $_[1] > 0 ? -1 : 1; $c->yviewScroll($unit => 'units'); }, Ev('D')]
);

MainLoop;
OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/)
--

Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html
Perl-Entwicklung: http://perl-services.de/

View full thread Scrolled - Canvas mit Mausrad scrollen - nicht ?