Re: Perl Tk:Scheduler command called subroutine fails to talk to tk widgets
- From: Dominique Dumont <dominique.dumont@xxxxxx>
- Date: Fri, 02 Feb 2007 09:46:02 GMT
"Andy" <anedza@xxxxxxxxxxxxxxxxxxxxxx> writes:
Does anyone know why? Do I have to call some sort of "refresh" tk
command or release tk resources?
Have you tried with an anonymous sub ? This sub is stored inside a
lexical variable so there's no problem with namespace.
I.e. (untested) :
use Tk;
use Tk::Schedule;
my $mw = MainWindow->new;
my $txtbox ; # variable declared before anon sub creation
my $run = sub {
print "start run\n";
$txtbox->insert(end,"this just hangs\n");
print "exit run\n";
} ;
my $s = $mw->Schedule(
-interval => 60,
-repeat => "once",
-command => [ $run, "junk"],
-comment => "1-9999"
)->pack();
$txtbox=$mw->Text(-width => 79,
-height => 8,
)->pack();
$txtbox->insert(end, "this works\n");
MainLoop;
# HTH
--
Dominique Dumont
"Delivering successful solutions requires giving people what they
need, not what they want." Kurt Bittner
.
- Follow-Ups:
- Prev by Date: Re: Perl Tk:Scheduler command called subroutine fails to talk to tk widgets
- Next by Date: Re: Perl Tk:Scheduler command called subroutine fails to talk to tk widgets
- Previous by thread: Re: Perl Tk:Scheduler command called subroutine fails to talk to tk widgets
- Next by thread: Re: Perl Tk:Scheduler command called subroutine fails to talk to tk widgets
- Index(es):
Relevant Pages
|
|