Re: Connection methods

From: Date: Sun, 16 Oct 2005 20:37:52 +0000
Subject: Re: Connection methods
References: 1 2 3 4 5 6 7 8 9 10 11  Groups: php.gtk.dev 
Request: Send a blank email to php-gtk-dev+get-1843@lists.php.net to get a copy of this message
Hello, I think connect() and connect_simple() will be enough. I particullary just use connect_object() since php-gtk-0.0.1 came out, because almost 100% of the time you don't need the widget that fired the signal, and sometimes you need the event and other parameters it generates. But I liked the idea of the duo connect() and connect_simple() also. I guess the programmers will use most connect_simple() and sometimes they'll use connect() when the callback parameters are needed. I would like we define these things soon in order to have a good start point for documentation and for application developments. Also I'm writing an article for Php Solutions Magazine to show some of the new features of PHP-GTK2 and I'll use connect() because I know this one won't change anymore ;-) ASAP I'll make it available under our site. best regards Pablo On Dom, 2005-10-16 at 12:46 -0700, Andrei Zmievski wrote: > On Oct 16, 2005, at 5:58 AM, Steph wrote: > > > The one just about everyone uses is $window->connect_object('destroy', > > array('gtk', 'main_quit')); > > This is precisely what connect_simple() is for: it'll just invoke > gtk::main_quit() without passing it anything. > > > > You'd also use it anywhere you didn't want to pass the initial > > object but > > wanted to use one of its signals, and that does arise a fair deal. > > Sometimes you'll need the signal's parameters to be passed too, > > sometimes > > you won't. In event signals it's fairly common to want to do > > something with > > $event as well as with your user data (ie other widgets etc), but > > at present > > we don't have a way of passing $event without passing the initial > > object. > > But how will connect_replace() help you here? You will still need to > pass an object, albeit not the one that emitted the signal, so the > function signature will stay the same. > > -Andrei > -- :: Pablo Dall'Oglio :: www.solis.coop.br - Lajeado, RS - Brasil :: www.dalloglio.net - Personal Home Page :: The software is free, but the work isn't.

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