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

Spieler
 2007-10-01 02:57
#100167 #100167
User since
2007-09-24
70 Artikel
BenutzerIn
[default_avatar]
Hallo,
Das Thema ist ja eigentlich durch, aber trotzdem:
Das Problem scheint mir eher am focus zu liegen:

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
 use warnings;
use strict;

use Tk;

my $mw = MainWindow->new;
my $e = $mw->Entry ->pack;
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;

my $ic = $c->Subwidget('scrolled');
$mw->MouseWheelBind($ic);
$ic->Tk::bind('<1>',[$ic,'Tk::focus']);

MainLoop;


Funktioniert bei mir und scheint mir sinnvoller, insbesondere wenn man noch andere 'Scrolled' widgets in der Applikation hat.

Christoph

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