Re: Appl. freeze until function is complete
| From: | Eric Blount | Date: | Wed, 17 Sep 2003 19:54:04 +0000 |
| Subject: | Re: Appl. freeze until function is complete | ||
| References: | 1 2 3 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-3911@lists.php.net to get a copy of this message | ||
I think what you want is on this page:
http://gtk.php.net/manual/en/gtk.method.events_pending.php
Put the line from the example on that page into the while loop that gets the
results. If that while loop is taking a while (no pun intended), your
php-gtk program will still respond to the user.
But if the function that is hanging is the actual query to the LDAP server,
you may be SOL. There's not much to be done about that, except maybe looking
into the program execution functions and forking a separate process to get
the results. Or maybe you could run a program from exec() that returns right
away and executes another program to get the results - that second program
could write to a file that your main program could read; inter-program
communication would suck...
HTH,
Eric
----- Original Message -----
From: "Bernd Maier" <bernd@netmeeting.dynxs.org>
To: <php-gtk-general@lists.php.net>
Sent: Wednesday, September 17, 2003 10:36 AM
Subject: Re: [PHP-GTK] Appl. freeze until function is complete
Hi,
thanks for the answer. I have already read about
gtk::timeout_add($time, 'function_name);
But my understanding for this command is, that "function_name" will called
periodically every $time Seconds. Is my understanding wrong?
Means gtk::timeout_add($time, 'function_name); that "function_name" will
"executed" $time seconds and then will returned an error, if the function is
not completed?
thanks in advance, Bernd Maier
"Paul Zirkle" <keless@skyesurfer.net> schrieb im Newsbeitrag
news:004101c37ca9$437deff0$0200a8c0@CABBIT...
> look into gtk::timeout_add($time, 'function_name);
>
> -Paul Zirkle AKA Keless
>
> ----- Original Message -----
> From: "Bernd Maier" <bernd@netmeeting.dynxs.org>
> To: <php-gtk-general@lists.php.net>
> Sent: Tuesday, September 16, 2003 2:49 PM
> Subject: [PHP-GTK] Appl. freeze until function is complete
>
>
> > Hi all,
> >
> > i fight hard with php-gtk...I have written a aplication wich querys a
LDAP
> > Server and displays the result in a clist. Works fine.
> >
> > But sometimes the Server needs very long to answer. For this case i
would
> > have a "cancel" Button wich stops the query. But how can i realize this?
> The
> > Program "hangs" in the function wich querys the Server and the GUI is
> > blocked.
> >
> > Is there any posibility to implement a "timeout" in a function?
> >
> > If someone is here who can help me i will be verry happy. Thanks a lot
in
> > advance,
> > Bernd
> >
> > --
> > PHP-GTK General Mailing List (http://gtk.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
--
PHP-GTK General Mailing List (http://gtk.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php