in reply to Re: Use of break in Tkx
in thread Use of break in Tkx

Nope, doesn't.
For information: I am using ActiveState Perl v. 5.14.2, Tkx (and Tcl) are standard included, Tk isn't.
OS is Windows 7 64-bit.

Replies are listed 'Best First'.
Re^3: Use of break in Tkx
by Anonymous Monk on Mar 29, 2013 at 15:11 UTC

    Nope, doesn't.

    Sure it does, if you insert it at "break here" it will break -- it still pops up an error dialog (not very useful) but it calls break and breaks :) you should report bug to Tkx author

    ... Tk isn't.

    And then you install Tk

      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;

        use it anywhere you want, Tkx::break(), and then suffer the popup bug (its a bug)