Re: Problems with Gtk::timeout_add()

From: Date: Wed, 15 Nov 2006 13:40:06 +0000
Subject: Re: Problems with Gtk::timeout_add()
References: 1 2 3  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-7472@lists.php.net to get a copy of this message
ecc wrote:
Ok, i will remove the "return true", but why? :-) Why will this work, if i dont return anything?
If a callback to timeout_add() returns true, it signals to PHP-GTK that the callback has completed everything it needs to do and that it shouldn't be called anymore. Returning false, or something that evaluates to false such as nothing, indicates that the callback still has more work to do and should be called again at the next interval.
Is it right, that i could end my function getSearchResultForStringFilter with "return true", or should i also remove this?
public function getSearchResultForStringFilter() { Gtk::timeout_add(1000, array($this, 'getSearchResultForString')) return true; }
You can leave the return true here since it is not being used as a callback method. -- Scott Mattocks Author of: Pro PHP-GTK http://www.crisscott.com

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