Re: Re: ext/libglade complete?
| From: | Steph Fox | Date: | Sun, 30 Oct 2005 21:02:41 +0000 |
| Subject: | Re: Re: ext/libglade complete? | ||
| References: | 1 2 3 4 5 6 | Groups: | php.gtk.dev |
| Request: | Send a blank email to php-gtk-dev+get-2008@lists.php.net to get a copy of this message | ||
> On Oct 30, 2005, at 11:36 AM, Steph Fox wrote:
>
> > 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.
>
> <groan>
>
> Of course there is no such API in Glade. I just sat on my ass, stared
> at the ceiling tiles for a bit, and invented it. Is that so wrong?
> Besides, signal_autoconnect() in Glade is C, which means that it only
> looks at the C level functions.
It's wrong, because the object being passed is defined in the Glade file...
> > 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?
>
> The issue with 'MyApp::on_ok_clicked' is that you are required to
> know the name of the implementing class in PHP during implementation
> of your Glade interface. That sucks. The issue with self::, well, I
> still need to see what self:: resolves to during signal_autoconnect()
> call. I'm building Glade2 right now so I can try it out.
Yes, sorry, I didn't realise that was a serious question. Having to
download PHP 5.1 from scratch over a very slow connection at present so I
can find out. (I broke it somehow, don't ask.)
> > 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.
>
> Is there precedence for 'MyApp::callback' syntax? If you are not
> happy about having a separate signal_autoconnect_object() method, it
> wouldn't be that hard to modify signal_autoconnect() to check whether
> it got an object instance as the first parameter, and if so, hook up
> the callbacks to it.
> I prefer to have a separate function because it's cleaner.
Yes, I'm thinking that way now too.
- Steph
>
> - Andrei
>
> --
> PHP-GTK Development Mailing List (http://gtk.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>