in reply to How to change cursor position
you want focus(). Here is an example:
use strict; use warnings; use Tk; my $mw = tkinit; my @e = map {$mw->Entry->pack} (0..4); my $b = $mw->Button(-text => 'clear', -command => sub{for (@e){$_->delete(0,'end')} $e[0]->focus; })->pack; MainLoop;
|
|---|