in reply to Re^2: How to validate text in Text widge
in thread How to validate text in Text widge
#!/usr/bin/perl -- use strict; use warnings; use Tk; my $mw = tkinit; my $tt = $mw->Scrolled('Text')->pack; $tt->bind( '<Key>' => sub { warn $Tk::event->k, ' ', $Tk::event->K; } +, ); $tt->bind( 'Tk::Text' => '<Key-semicolon>' => 'NoOp' ); $tt = $mw->Scrolled('Text')->pack; $tt->bind( 'Tk::Text' => '<Key-semicolon>' => sub { warn 'semicolon re +jected '; return !!0; } ); $mw->WidgetDump; use Tk::WidgetDump; $tt->focus; $mw->MainLoop;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: How to validate text in Text widge ( Tk::NoOp )
by Kafka (Acolyte) on Jan 04, 2016 at 08:27 UTC |