I have a <Tab> binding for a entry widget, where I destroy the widgets parent after processing. I get an error because after running my subroutine Tkx tries to find the field for the next focus for the parent widget that does not exist anymore:
bad window pathname ".t.e"
I would like to use the break command (as mentioned in the documentation of bind) to prevent Tkx from executing further bindings. However, all syntaxes I could think of give an error. Obviously I can't think of the right syntax OR the break command does not funktion.
This is the stripped code:
use strict; use warnings; use Tkx; my $mw = Tkx::widget -> new ('.'); $mw -> g_wm_iconify; my $Fkrs = $mw -> new_toplevel; my $fac = ''; my $Ffac = $Fkrs -> new_entry (-textvariable => \$fac, -width => 8); $Ffac -> g_grid (-row => 0, -column => 0, -sticky => 'ew'); $Ffac -> g_bind ('<Tab>', [\&fac, \$fac, \$Ffac, \$Fkrs]); Tkx::update (); while (Tkx::i::call('winfo', 'exists', $Fkrs)) {Tkx::i::DoOneEvent(0)} +; Tkx::update (); die "Normal end"; sub fac { my ($p_fac, $p_Ffac, $p_Fkrs) = @_; if ($$p_fac =~ /^(?=.+)\d*(\.\d+)?$/) { # I would like to use the break here!!; $$p_Fkrs -> g_destroy; } else { $$p_fac = ''; } }
In reply to Use of break in Tkx by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |