Fw: [PHP-GTK-DEV] Re: [PHP-GTK] ext/libglade complete?
| From: | Steph Fox | Date: | Sun, 30 Oct 2005 19:52:58 +0000 |
| Subject: | Fw: [PHP-GTK-DEV] Re: [PHP-GTK] ext/libglade complete? | ||
| Groups: | php.gtk.dev | ||
| Request: | Send a blank email to php-gtk-dev+get-1998@lists.php.net to get a copy of this message | ||
I lied about Thing 3. There's a precedent in Perl. Something like
signal_autoconnect_from_package($obj);
----- Original Message -----
From: "Steph Fox" <steph@zend.com>
To: "Andrei Zmievski" <andrei@gravitonic.com>
Cc: "PHP-GTK dev" <php-gtk-dev@lists.php.net>
Sent: Sunday, October 30, 2005 7:36 PM
Subject: [PHP-GTK-DEV] Re: [PHP-GTK] ext/libglade complete?
> > We're all getting confused here, partly because I don't have Glade2
> > installed yet, I think. When you talk about "object instance
> > specified via Glade ('button'3)", are you talking about a widget
> > named 'button3'? If so, it has nothing to do with what I suggested,
> > which is being able to easily connect a bunch of callbacks to methods
> > of a PHP object. Like this:
> >
> > class MyApp {
> >
> > function on_ok_clicked($button) { ... }
> > function on_notebook_switched_page($notebook, $page) { ... }
> > function on_destroy($widget) { ... }
> >
> > }
> >
> > $app = new MyApp();
> >
> > $glade = new GladeXML($file);
> > $glade->signal_autoconnect_object($app);
> >
> > Now everything is connected to the methods of that object.
>
> Thing 1, which you won't know yet because you don't have the code handy,
is
> there is no such thing as signal_autoconnect_object() in libglade now.
> signal_autoconnect() does it all.
>
> Thing 2 is that there's already a way to achieve this. I don't see what's
> so problematic about having a callback in the Glade file called
> 'MyApp::on_ok_clicked'... if you have some issue with the callbacks being
> public you can just move the whole lot, including the call to gtk::main(),
> inside the class and use self:: instead. What am I missing here?
>
> Thing 3 is that there's no precedent for that syntax. Doesn't mean it
> couldn't be done, but _should_ it be done? - personally I think not, given
> that you were right about the need for the optional array parameter to
pass
> data. The main problems with the signal_autoconnect() function are the
ones
> I'm working on addressing now.
>
> - Steph
>
> --
> PHP-GTK Development Mailing List (http://gtk.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>