Re: PHP Classes Question
| From: | Andrei Zmievski | Date: | Tue, 06 Mar 2001 16:20:49 +0000 |
| Subject: | Re: PHP Classes Question | ||
| References: | 1 | Groups: | php.gtk |
| Request: | Send a blank email to php-gtk+get-407@lists.php.net to get a copy of this message | ||
On Tue, 06 Mar 2001, Barry Mitchelson wrote:
> hi (again),
>
> I'm trying to write my Gtk app as part of a class, but I can't connect my class
> methods as functions - I get the error :
>
> 'connect() expects argument 2 to be callable'
>
> here's a tiny example of what I'm trying to do :
>
> class myApp
> {
> function myApp()
> {
> $this->window = &new GtkWindow();
> $this->window->connect('destroy',$this->destroy);
Try:
$this->window->connect('destroy', array($this, 'destroy'));
That's pretty much standard PHP syntax for specifying object callbacks.
-Andrei
* We reason deeply, when we forcibly feel. *