Re: cos we really need another chat system...

From: Date: Thu, 08 Nov 2001 15:20:17 +0000
Subject: Re: cos we really need another chat system...
References: 1 2  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-548@lists.php.net to get a copy of this message
Cheers guys , that did the job for others interested... function start_loop(){ my_function(); Gtk::timeout_add(1000, 'start_loop'); } does the job beautifully. Note the manual shows 'XXX timeout_add(XXX);' , (its looking better every time I look!) So without the link to the sample Alan Knowles posted I was no wiser, wondering should I add the snippet to the user-contributed notes... or is that a bit lame? be honest now :) Thanks again all Simon Wheeler firepages. ----- Original Message ----- From: "Alan Knowles" <alan_k@hklc.com> To: "Simon Wheeler" <fire@firepages.org>; <php-gtk-general@lists.php.net> Sent: Friday, November 09, 2001 10:35 PM Subject: Re: [PHP-GTK] cos we really need another chat system... > Simon Wheeler wrote: > > >NO worries , Its just for part of my learning process (a slow one at that) and a project to play with. > > > >So I am making a chat app with PHP-GTK, but I need to periodically ask the server for information and grab the latest XML file/whatever. > >So I need a loop that every $x seconds runs a function. This I can achieve , but not without freezing the whole app, I mean its working... and refreshing the data but I can not actually use the app when this is happening, which is all the time :), using sleep() for timing etc does exactly that. > > > >Any ideas/examples would be much appreciated. > > > >I guess the 'while (gtk::events_pending())' thingy (I think thats the technical term for it) is going to be mentioned again , which is a shame as I have had no success (or errors!) using it. > > > > http://gtk.php.net/manual/en/gtk.method.idle_add.php > > http://gtk.php.net/manual/en/gtk.method.timeout_add.php > > there is a bit of an example at the end of > > > http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/phpmole-ide/phpmole/dialogs/p hpide.class?rev=1.2&content-type=text/vnd.viewcvs-markup > > the commented out > > gtk::timeout_add(15000, 'dummy_timer'); > > > -- > Linux Center Hong Kong Ltd. - Center of Excellence > The next generation OS available now. > www.hklc.com alan_k@hklc.com > www.hklc.com/infocenter Alan's Linux Infocenter > > >

« previous php.gtk.general (#548) next »