Thread im Browse Entry Zeile vorwählen (1 answers)
Opened by Gast at 2007-02-23 21:31

PerlProfi
 2007-02-24 08:47
#46237 #46237
User since
2006-11-29
340 Artikel
BenutzerIn
[default_avatar]
Du musst -variable vorbelegen:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/perl
use strict;
use warnings 'all';
use Tk;
use Tk::BrowseEntry;

my $mw = tkinit();

sub createbe
{
my($num, $values) = @_; # pick parameters

# create BrowseEntry
my $be = $mw -> BrowseEntry(-background => 'white')->pack();
$be->{MY_VAR} = $values->[$num];
$be -> configure(-variable => \$be->{MY_VAR});

# insert values
foreach (@$values)
{ $be -> insert('end', $_) }

# return BrowseEntry
return $be;
} # createbe

createbe(0, ['A'..'Z']);
createbe(1, ['a'..'z']);
createbe(2, [ 1 .. 9 ]);

MainLoop;


MfG\n\n

<!--EDIT|PerlProfi|1172303959-->

View full thread im Browse Entry Zeile vorwählen