Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Perl/TK Tk_Freecursor-Error

129 views
Skip to first unread message

pit

unread,
Aug 20, 2015, 8:04:59 AM8/20/15
to
Hi All,

I have the following problem with programs in perl/tk under Windows 8.1 with perl 5.14 and TK version 804.032

In the program exists an HList. When I scroll down the list and then finish the program, comes the following message:

"Tk_FreeCursor received unknown cursor argument"

and the program doesn't finish correctly.

Can someone help me ?

Pit

$Bill

unread,
Aug 20, 2015, 5:02:42 PM8/20/15
to
Remove as much code as you can where it still reproduces the error. This
will either give you an idea of where the fault is or you can post the
small remaining snippet for others to peruse/try.

pit

unread,
Aug 24, 2015, 6:16:52 AM8/24/15
to
here is my the code snippet:

use strict;
use Tk;
use Tk::HList;

my $mw = MainWindow->new(-title => 'Mainwindow',
-cursor => 'arrow');
$mw->protocol("WM_DELETE_WINDOW", \&del_win);

my $cursor = $mw->cget(-cursor);

my $hl = $mw->Scrolled('HList',
-columns => 1,
)->pack(-expand => 1,
-fill => 'both',
-side => "top",
-anchor => "nw");

my $i;
for ($i = 0; $i <= 20; $i++)
{
$hl->add($i);
$hl->itemCreate($i, 0, -text => $i);
}

$hl->update();

MainLoop;

sub del_win
{
$mw->destroy();
Tk::exit(1);
}

Start the program, scroll down some lines and finish the program, then the error will be occured. When scrolling down and scroll up again to the first line, it doesn't happen.

pit

$Bill

unread,
Aug 24, 2015, 2:28:04 PM8/24/15
to
On 8/24/2015 03:16, pit wrote:
> Am Donnerstag, 20. August 2015 23:02:42 UTC+2 schrieb $Bill:
>> On 8/20/2015 05:04, pit wrote:
>>> Hi All,
>>>
>>> I have the following problem with programs in perl/tk under Windows 8.1 with perl 5.14 and TK version 804.032
>>>
>>> In the program exists an HList. When I scroll down the list and then finish the program, comes the following message:
>>>
>>> "Tk_FreeCursor received unknown cursor argument"
>>>
>>> and the program doesn't finish correctly.
...
> Start the program, scroll down some lines and finish the program, then the error will be occured. When scrolling down and scroll up again to the first line, it doesn't happen.

I can't reproduce it, so that leads me to believe it's a version/platform issue.
I'm on Doze 8.1 with AS Perl 5.20 and Tk 804.033

See if this one does the same (removed the delete window parts).

use strict;
use warnings;
use Tk;
use Tk::HList;

my $mw = MainWindow->new(-title => 'Mainwindow', -cursor => 'arrow');
my $cursor = $mw->cget(-cursor);
my $hl = $mw->Scrolled('HList', -columns => 1,)->pack(
-expand => 1, -fill => 'both', -side => "top", -anchor => "nw");
$mw->Button(-text => 'Quit', -command => sub { exit; })->pack(
-side => 'bottom');
for (my $i = 0; $i <= 20; $i++) {

neko...@gmail.com

unread,
Feb 16, 2019, 11:50:43 PM2/16/19
to
3 years later I found this issue to still be occurring on 64-bit builds of Perl. It seems that a type Tk_Cursor was added to replace Cursor and not all files were updated with the new type. On 32-bit builds there is no difference between the two but on 64-bit builds Tk_Cursor is a 64-bit value and Cursor is a 32-bit value which leads to errors when dereferencing Tk_Cursor pointers that are actually backed by 32-bit Cursor data types.

I created a PR that resolves the issue but Perl::Tk doesn't seem to be maintained anymore. https://github.com/eserte/perl-tk/pull/40

0 new messages