Perl Tk:Scheduler command called subroutine fails to talk to tk widgets



I'm using the CPAN Tk::Scheduler module to time control the execution
of subroutines within my Perl script. I want to display the results
of a scheduled task in a tk text widget. But, when my subroutine gets
invoked by the scheduler via the -command switch, the called
subroutine itself seems to be unable to talk to any Perl::Tk widgets;
all such calls within the subroutine hang. Everything else seems to
work ok.

Does anyone know why? Do I have to call some sort of "refresh" tk
command or release tk resources?

use Tk;
use Tk::Schedule;

my $mw = MainWindow->new;

my $s = $mw->Schedule(
-interval => 60,
-repeat => "once",
-command => [\&run, "junk"],
-comment => "1-9999"
)->pack();

my $txtbox=$mw->Text(-width => 79,
-height => 8,
)->pack();
$txtbox->insert(end, "this works\n");

MainLoop;

sub run{
print "start run\n";
$txtbox->insert(end,"this just hangs\n");
print "exit run\n";
}

.



Relevant Pages

  • Re: Subroutine Returns Parameters Displaced
    ... If you have all of the source code, then a mass recompile is a good fix, ... Subroutine Returns Parameters Displaced ... alphanumeric or display numeric. ... To join/leave the list, search archives, change list settings, * ...
    (comp.sys.hp.mpe)
  • Re: Subroutine Returns Parameters Displaced
    ... Subroutine Returns Parameters Displaced ... Walsh, Edward wrote: ... First, I have run the test with "display functions" on in Reflection, and I did not see any strange characters embedded. ... responsible to deliver it to the intended recipient, ...
    (comp.sys.hp.mpe)
  • Re: Subroutine Returns Parameters Displaced
    ... Subroutine Returns Parameters Displaced ... Walsh, Edward wrote: ... First, I have run the test with "display functions" on in Reflection, and I did not see any strange characters embedded. ... responsible to deliver it to the intended recipient, ...
    (comp.sys.hp.mpe)
  • Re: Subroutine Returns Parameters Displaced
    ... Walsh, Edward wrote: ... The particular subroutine which first showed this problem was first written about five years ago, and has had almost no change since then. ... First, I have run the test with "display functions" on in Reflection, and I did not see any strange characters embedded. ... responsible to deliver it to the intended recipient, ...
    (comp.sys.hp.mpe)
  • Re: Subroutine Returns Parameters Displaced
    ... Subroutine Returns Parameters Displaced ... First, I have run the test with "display functions" on in Reflection, ... The information contained in this electronic message is intended for ... responsible to deliver it to the intended recipient, ...
    (comp.sys.hp.mpe)