Re: Re: ext/libglade complete?

From: Date: Sun, 30 Oct 2005 21:28:23 +0000
Subject: Re: Re: ext/libglade complete?
References: 1  Groups: php.gtk.dev 
Request: Send a blank email to php-gtk-dev+get-2017@lists.php.net to get a copy of this message
On Oct 30, 2005, at 1:19 PM, Steph Fox wrote:
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.
Erm, wait, I just realized what you meant by that. No, it's not cleaner, because of the way Glade works. In PHP-GTK 1, if you set up the object to be passed in Glade it never worked, because signal_autoconnect() didn't recognise it.
PHP-GTK 1 only cared about functions, really.
This way, it does work, and signal_autoconnect() caters for four separate kinds of signals. Its only problems are a) passing data and b) connecting to a callback defined within a class, non-statically.
I'm still not sure what you're talking about here, "four separate kinds of signals". I think it may be best if I just re-implement signal_autoconnect() and take a vote on the implementation.
I think it would be sensible to have a separate function that passed an object as first parameter if you wanted to be able to access callbacks within that class, and data mapping as a second parameter. I don't think it would be a good idea to call it signal_autoconnect_object() though, because that means something other.
Ok, I definitely need to reimplement it now. Build faster, Glade2! - Andrei

« previous php.gtk.dev (#2017) next »