in reply to Re: Using Ctrl A and del in the Entry widget in perl tk
in thread Using Ctrl A and del in the Entry widget in perl tk

I think the OP meant "Use Ctrl+A to select the entire entry, and then Del to delete it". Or maybe not?
  • Comment on Re^2: Using Ctrl A and del in the Entry widget in perl tk

Replies are listed 'Best First'.
Re^3: Using Ctrl A and del in the Entry widget in perl tk
by zentara (Cardinal) on Oct 21, 2011 at 11:42 UTC
    Thats easy enough to accomplish, since after a selection, a Delete press will delete the selection.
    #!/usr/bin/perl use warnings; use strict; use Tk; my $mw = new MainWindow; my $ent = $mw -> Entry( -bg => 'white', -selectbackground => 'hotpink', ) -> pack(); $ent->focus; $ent->bind('<Control-a>', \&select_it ); MainLoop; sub select_it{ $ent->selectionRange(0,'end'); }

    I'm not really a human, but I play one on earth.
    Old Perl Programmer Haiku ................... flash japh