[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-gtk-general
Subject:    Re: [PHP-GTK] Problems with Gtk::timeout_add()
From:       Scott Mattocks <scott () crisscott ! com>
Date:       2006-11-15 15:10:43
Message-ID: 455B2DF3.5000808 () crisscott ! com
[Download RAW message or body]

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

-- 
PHP-GTK General Mailing List (http://gtk.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic