Subject: | [Win 7 x64] "Tk_FreeCursor received unknown cursor argument" while using Tk::HList |
Hi!
I get an error when using "large" amounts of data in a Tk::Hlist and closing the main window.
It says: "Tk_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."
This happen on my windows machine, on mac it works fine.
Here is all system info:
OS: Windows 7 x64
Perl: Strawberry Perl 5.12.2 (64-bit)
Tk: latest
Please find attached an example script repoducing the error on my system. Once started,
please select some various values by double-clicking on items in the list. Then, lcose the
window using the [x] button in the right upper corner. Now, there should raise the error
mentioned above.
Maybe you have an idea what this is about - I don't :-s
Kind regards,
Alex
Subject: | hlist_stresstest.pl |
#!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