Re: timeout_add question
| From: | Alan Knowles | Date: | Tue, 19 Feb 2002 14:02:15 +0000 |
| Subject: | Re: timeout_add question | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-1280@lists.php.net to get a copy of this message | ||
Rich Payne wrote:
On Tue, 19 Feb 2002, Gregory Kaczmarczyk wrote:dont forget the &$this - otherwise you will call a copy of the class instanceIf I have a class (e.g. below), and I would like to add gtk::timeout_add to the get_stuff function calling the get_stuff function, how can I do that? class myClass { function set_stuff(...) {Is the timeout being called from instide that function that's starting it? In either case, yes, you need something like this: gtk::timeout_add(200,array($this,'get_stuff'));...} function get_stuff() {... gtk::timeout_add(200, 'get_stuff');} } With the example, I get the error: Unable to call handler callback 'get_stuff' specified in myfile.php on line 107. Would I need to specify the function using "$this" somehow?
--rdp