为什么这段代码没有将光标移动到条目的最后一个字符?
use Gtk2 '-init';
my $window = Gtk2::Window->new;
my $entry = Gtk2::Entry->new;
my $handler;
$handler = $entry->signal_connect ( 'insert-text' =>
sub {
my (
$entry,
$chrs,
$len,
$pos_strange,
$handler,
) = @_;
$entry->signal_handler_block ( $$handler );
$entry->set_text ( 'tryme' );
$entry->signal_stop_emission_by_name ('insert-text');
$entry->signal_handler_unblock ( $$handler );
$entry->set_position ( -1 );
},
\$handler
);
$window->set_size_request ( 200, 100 );
$window->add ( $entry );
$window->set_position ('center_always');
$window->show_all;
$window->signal_connect ( delete_event => sub { Gtk2->main_quit; } );
Gtk2->main;