nzsvz9 has asked for the wisdom of the Perl Monks concerning the following question:

Need help with perl Tk in Strawberry perl 5 version 30 subversion 1 (v5.30.1 for MSWIN32-x64) Many times in my application I get the following error on exit "Tk_FreeCursor received unknown cursor argument" and "Tool completed with exit code 255"

There seems to be a ticket in it: https://groups.google.com/g/comp.lang.perl.tk/c/chS7mupl5Hw?pli=1

I would fix it myself, if I knew how, but alas - I am but a plebe.

Can anyone out there kill this one. The error on exit makes my par'd application look wonky and unprofessional. Perhaps it is a reflection of the programmer, but I digress.

For those of you curious, you can find my application I built here: http://rkssoftware.wixsite.com/pixelation

Any assistance would be appreciated.

  • Comment on Tk_FreeCursor received unknown cursor argument

Replies are listed 'Best First'.
Re: Tk_FreeCursor received unknown cursor argument
by Anonymous Monk on Sep 04, 2020 at 00:45 UTC

    Where do you see "Tool completed with exit code 255"????

    When you use this tk-hlist_stresstest.pl, do you also the error? What line exactly triggers the error ( use Devel::Trace )?

    #!/usr/bin/perl -- #!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(); 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 ], ); }

    What happens when you use  use Win32API::File(); Win32API::File::SetErrorMode(2);

    What happens if you end program with  POSIX::_exit(0);?

Re: Tk_FreeCursor received unknown cursor argument
by Anonymous Monk on Sep 03, 2020 at 21:24 UTC
    Hi. Start with a minimal program and info to reproduce bug-- the beginning
      Start with a minimal program and info to reproduce bug

      nzsvz9, could you also tell us which version of Tk you are using.
      If it's not (the latest) version 804.035, try upgrading to that latest version and see if that fixes the problem.

      Cheers,
      Rob