Use waitVariable method of widget
$widget->waitVariable(\$var);
To have a program wait until a variable is set, call waitVariable. The
value of $var must be undefined before u call waitVariable and
processing will resume as soon as $var is defined..
U can define $var when the first routine finishes.
For example,
&firstFunction;
$widget->waitVariable(\$var);
&secondFunction;
During the last stage of it's execution firstFunction defines $var and
hence the processing proceeds from that point ownwards
U can also read about:
waitVisibility
waitWindow
Cheers
Mayank
"Zielfelder, Robert" wrote:
>
> How do I know when this first routine finishes so I can launch the second at
> the right time?
>
>
> Rz
>
> -----Original Message-----
> From: Eric Wang [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, May 07, 2002 3:06 PM
> To: Zielfelder, Robert
> Cc: Perl Beginners List (E-mail)
> Subject: Re: PerlTK and subroutines
>
> I think you should wait for the first sub routine to return first
> then
> launch the second one.
>
> *********************************************************
> *Eric T. Wang *
> *Bioinformatic Support and SRA *
> *University of California, Irvine College of Medicine *
> *Department of Biological Chemistry *
> *RK Moyzis Lab *
> *[EMAIL PROTECTED] *
> *949-824-1870 *
> *********************************************************
>
> On Tue, 7 May 2002, Zielfelder, Robert wrote:
>
> > Greetings,
> >
> > I am having trouble with calling a perl script from within a
> parent script.
> > I am using PerlTK to display a gui that contains several buttons.
> When the
> > user clicks a button, another script is sourced and run. I also
> wanted to
> > have a "master button" that when pressed would run each of the
> sub-scripts
> > in order. My problem is that when the master button is pressed,
> the first
> > sub-script starts as it should and does the first few things it is
> supposed
> > to. However, it too has a perlTK gui that asks the used for
> information.
> > Instead of displaying this gui, the next script that the parent
> script
> > sourced begins to run.
> >
> > Attached is the bit of code for the master button. Does anyone
> have any
> > ideas what I am doing incorrectly?
> >
> >
> > $go_b = $aw->Button(
> > -text => "RUN SELECTED",
> > -background => "green",
> > -foreground => "black",
> > -activebackground => "green",
> > -activeforeground => "black",
> > -cursor => "hand1",
> > -justify => "center",
> > -font => "helvbo18",
> > -relief => "raised",
> > -command => sub {
> > if ($run{drill}) {
> > do
> > "/genesis/sys/scripts/A/output/drill_out";
> > }
> > if ($run{rout}) {
> > do
> "/genesis/sys/scripts/A/output/rout_out";
> >
> > }
> > },
> > )->place(-anchor => "sw",
> > -relx => "0",
> > -rely => "1",
> > -relwidth => ".5",
> > -relheight => ".05",
> > );
> >
> >
> > Best Regards,
> >
> > Robert Zielfelder
> >
> >
> >
> > --
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--
Regards
Mayank
"The difference between ordinary and extraordinary is that little extra"
-Anon
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]