Thread Tk::Text -> focus aus Tk::JBrowseEntry setzen (6 answers)
Opened by GoodFella at 2007-04-08 09:01

Sucher
 2007-04-08 13:30
#46287 #46287
User since
2007-03-26
47 Artikel
BenutzerIn
[default_avatar]
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use strict;
use warnings;

use Tk;
require Tk::JBrowseEntry;
my $mw = MainWindow->new;
my @headlines = qw/foo bar baz/;
my $headline;

my $text_data = $mw->Text( -height => 8,
-width => 122 )->pack;
my $be_add = $mw->JBrowseEntry( -state => 'readonly',
-variable => \$headline,
-choices => \@headlines,
-width => 20)->pack;
$be_add->configure( -browsecmd =>
sub { $text_data->insert('end',
"start $headline end_data\n");
$text_data->afterIdle([$text_data,'focus']);
} );
MainLoop;


Wenn du den Callback erst einmal zurückkehren lässt, funktioniert es. (OT:) Vielleicht willst du 'insert' benutzen: 'Insert' fügt am aktuellen Cursor ein.

Grüße

View full thread Tk::Text -> focus aus Tk::JBrowseEntry setzen