5
# $Id: browseentry2.t,v 1.9 2003/04/21 19:49:35 eserte Exp $
19
print "# tests only work with installed Test module\n";
26
BEGIN { plan tests => 6 }
28
if (!defined $ENV{BATCH}) { $ENV{BATCH} = 1 }
30
my $top = new MainWindow;
33
my $robe = $top->BrowseEntry
35
-label => "readonly, classic style",
37
-autolistwidth => 1, # list width is dynamically calculated
38
-autolimitheight => 1, # limit height of browseentry to number
40
-browsecmd => sub { warn "-browsecmd: @_\n" }, # old plain callback
41
-browse2cmd => sub { warn "-browse2cmd: @_\n" }, # -browsecmd with index as argument
45
$robe->insert("end", @INC);
47
ok(ref $robe, 'Tk::BrowseEntry');
48
ok($robe->isa('Tk::BrowseEntry'), 1);
51
my $robe2 = $top->BrowseEntry
53
-label => "normal, windows style",
54
-autolistwidth => 1, # list width is dynamically calculated
55
-autolimitheight => 1, # limit height of browseentry to number
60
$robe2->insert("end", 1, 2, 3, "a very long entry exceeding the normal width");
62
ok(ref $robe2, 'Tk::BrowseEntry');
63
ok($robe2->isa('Tk::BrowseEntry'), 1);
67
my $robe = $top->BrowseEntry
69
-label => "readonly, windows style",
70
-autolistwidth => 1, # list width is dynamically calculated
71
-autolimitheight => 1, # limit height of browseentry to number
77
$robe->insert("end", 1, 2, 3, "a very long entry exceeding the normal width");
79
ok(ref $robe, 'Tk::BrowseEntry');
80
ok($robe->isa('Tk::BrowseEntry'), 1);
82
$robe->configure(-variable => \$var);
85
$top->Button(-text => "Ok",
89
$top->after(60*1000, sub { $top->destroy });