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;
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.