Thread tk scrolled canvas (4 answers)
Opened by PerlProfi at 2006-12-17 20:52

PerlProfi
 2006-12-18 18:25
#46030 #46030
User since
2006-11-29
340 Artikel
BenutzerIn
[default_avatar]
Ich habe es mit Tk::bind versucht, aber in folgendem Beispiel klappt es nicht:
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/perl
use strict;
use warnings 'all';
use Tk;

my $mw = tkinit;
my $c  = $mw->Scrolled("Canvas", -background => "white")->pack;

$c->Tk::bind("<Button-1>", sub { print "\@_: @_\n" });

MainLoop;


Es funktioniert nur, wenn man anstatt von [font=courir]$c->Tk::bind[/font], dass hier: [font=courir]$c->Subwidget("canvas")->Tk::bind[/font] schreibt.

Muss man jetzt Subwidget nur bei lower(), raise(), focus() und bind() anwenden, oder gibt es noch andere Ausnahmen?

MfG PerlProfi

View full thread tk scrolled canvas