Re: Fw: [PHP-GTK] ext/libglade complete?
| From: | Andrei Zmievski | Date: | Sun, 30 Oct 2005 19:13:36 +0000 |
| Subject: | Re: Fw: [PHP-GTK] ext/libglade complete? | ||
| References: | 1 | Groups: | php.gtk.dev |
| Request: | Send a blank email to php-gtk-dev+get-1992@lists.php.net to get a copy of this message | ||
On Oct 30, 2005, at 9:09 AM, Steph Fox wrote:
OK, I see what you mean now. It's ugly, though - it makes a lot of unnecessary work, mapping every callback manually. The whole point of signal_autoconnect() is supposed to be that you don't need to do that. From source: /* * use gmodule to connect signals automatically. Basically a symbol with * the name of the signal handler is searched for, and that is connected to * the associated symbols. So setting gtk_main_quit as a signal handler * for the destroy signal of a window will do what you expect. */I _know_ what signal_autoconnect() is supposed to be. If you notice, the argument to the function in PHP-GTK is optional. If you don't specify it, then signal_autoconnect() looks in the function table to find the callbacks. The argument is mainly so you can remap certain handlers to specific function calls that are named different and/or pass custom user data.void glade_xml_signal_autoconnect (GladeXML *self);
I'll see if I can find a nicer way around it than we had in PHP-GTK 1 and keep to the spirit of the original. The marshal appears to allow user data to be passed, but I need to figure out how user data is specified in Glade.I don't think it will be possible. A lot of times the user data is dynamic, depending on what happened in the script before that, and Glade pretty much lets you specify only static data. -Andrei