Re: setting labels two time in a function
| From: | Rich Payne | Date: | Wed, 15 May 2002 14:49:53 +0000 |
| Subject: | Re: setting labels two time in a function | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-1979@lists.php.net to get a copy of this message | ||
I think you need one of the imfamous:
while (gtk::events_pending())
gtk::main_iteration();
after you change the text the first time. This lets GTK take care of any
pending events (like changing the text) before you launch into your long
processing function.
--rdp
On Wed, 15 May 2002, Henning Sprang wrote:
> hy,
> iwant to set a message in a label while my program does an action that can
> sometimes take some time so the user knows the program is working for a while.
>
> as i did experience problem with this i made a test.
> i set the label and let the program sleep for a long time so i can see the
> message in any case. parallel, to be sure my info variable is really filled
> with content i put it out to the commend line.
>
> the code looks like this:
>
> $infolabel->set_text($infotext[1]);
> echo "infotext 1 ist:" . $infotext[1];
> sleep(10);
>
> later, after my actions are done, i change the label again with
>
> $infolabel->set_text($infotext[2]);
>
> this one works fine.
>
>
> plus, on the comand line the output is shown, but i never get to see
> the first text-cahge in my label, only the second one.
>
> any reasons for this?
>
> could it be that calls to gtk object methods get only executed after a
> callback function is finished?
>
> any idea how this can be solved?
>
> henning
>
>
>
>
>
--
Rich Payne
http://talisman.mv.com