Re: Problems with Gtk::timeout_add()

From: Date: Wed, 15 Nov 2006 15:10:43 +0000
Subject: Re: Problems with Gtk::timeout_add()
References: 1 2 3 4 5  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-7474@lists.php.net to get a copy of this message
Sorry. I got things backwards. Return false to stop the callback from being called again the next interval and true to have it called again. ecc wrote:
Thank you for the answers.... i think, now its clear for me. Regards, andreas Scott Mattocks-2 wrote:
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 -- PHP-GTK General Mailing List (http://gtk.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
-- Scott Mattocks Author of: Pro PHP-GTK http://www.crisscott.com

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