Here's my Tcl/Tk bind/break test.
Just keep hitting <tab> and break stops you
reaching the second entry.
Where and in what form would you specify break in Perl/Tkx to get the second example working.
Thank you in anticipation.
_______TCL EG. WORKS WELL______
pack [entry .e1 -textvar v1 -width 50]
set v1 blob
pack [entry .e2 -textvar v2 -width 50]
set v2 blob
proc cb_entry {my_str} { puts -nonewline $my_str; flush stdout}
bind .e1 <KeyPress> {cb_entry $v1; break} ;#<======= break here
bind .e2 <KeyPress> {cb_entry $v2} ;
_______PERL EG. NEEDS BREAK_______
use Tkx;
my $mw;
sub cb_entry {my $win=$_[0]; $mw->g_wm_title("this is $win m8");}
sub main_loop {
my $v1;
my $v2;
$mw = Tkx::widget->new(".");
#WHERE AND HOW TO SPECIFY BREAK IN HERE????
my $e1 = $mw->new_ttk__entry( -width => 50,
-textvariable => \$v1, );
$e1->g_pack( -expand => 1, -fill => 'both', );
Tkx::bind($e1, "<Key>", [
sub { cb_entry($_[0]); }, Tkx::Ev("%W")
]);
my $e2 = $mw->new_ttk__entry( -width => 50,
-textvariable => \$v2, );
$e2->g_pack( -expand => 1, -fill => 'both', );
Tkx::bind($e2, "<Key>", [
sub { cb_entry($_[0]); }, Tkx::Ev("%W")
]);
Tkx::MainLoop();
}
main_loop;
|