QuoteTk_FreeCursor received unknown cursor argument
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!perl
use strict;
use warnings;
use Tk;
use Tk::HList;
my $mw = tkinit();
my $left = $mw->Frame(-bg => 'blue', -width => 210)->pack(-side => 'left', -fill => 'x', -expand => 1,);
put_hlist($left);
my $right = $mw->Frame(-bg => 'yellow')->pack(-side => 'left', -fill => 'both', -expand => 1,);
my $info = $right->Label()->pack(-fill => 'x');
$mw->MainLoop();
=head2 put_hlist( $parent_frame )
Erstelle eine HList mit vielen Einträgen und einem Binding.
=cut
sub put_hlist {
my $parent = shift;
my $hlist = $parent->Scrolled('HList',
-scrollbars => 'osoe',
-selectmode => 'single',
-columns => 2,
-header => 1,
-width => 100,
-height => 30,
-background => 'GhostWhite',
)->pack(-fill => 'both', -expand => 1);
$hlist->header(
'create',0,
-text => '#id',
);
$hlist->header(
'create',1,
-text => 'Eintrag',
);
foreach my $cnt ( 0 .. 10000 ) {
$hlist->add($cnt);
$hlist->item('create', $cnt, 0, -text => $cnt);
$hlist->item('create', $cnt, 1, -text => "Eintrag Nr. $cnt");
}
$hlist->configure(
-command => [sub{
my $hlist = shift;
my $info_label = shift;
my $selected_item_no = $hlist->info('selection');
return 0 unless defined $selected_item_no;
# -- get selected text id
my $text_id = $hlist->itemCget($selected_item_no, 0, '-text');
# -- display name in right frame
$info->configure(-text => $text_id);
return 1;
}, $hlist, $info],
);
} # /put_hlist