RE: [PHP-GTK] connect and connect_object
| From: | Steph | Date: | Sun, 18 Jul 2004 18:46:35 +0000 |
| Subject: | RE: [PHP-GTK] connect and connect_object | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-4782@lists.php.net to get a copy of this message | ||
I thought I'd already sent this, but seems I hit the wrong button..
$button->connect('clicked', 'callback', $parameter) would connect like this:
function callback($button, $parameter) {
/* blah */
}
$button->connect_object('clicked', 'callback', $parameter) would connect
like this:
function callback($parameter) {
/* blah */
}
So, for example, if you want to click a button and have an object other than
the button respond, you'd use connect_object() to pass that other object as
a parameter.
This is particularly useful when you want to call the same function with the
same parameter from a number of different places in your application.
HTH
> -----Original Message-----
> From: Wim Stockman [mailto:jazzboy@front.ru]
> Sent: 18 July 2004 19:23
> To: php-gtk-general@lists.php.net
> Subject: [PHP-GTK] connect and connect_object
>
>
> Hello Steph,
>
> since you seem to be right behind your computer. I have a little problem
> with connect and connect_object. could you try to explain to me what the
> difference is and what I should use . I'm used to program in C++ and I'm
> working with classes in PHP-GTK and I always get trouble with the
> connect function.
>
> Already Thx a lot
>
>
>
> Steph wrote:
>
> > > I'm trying to make a simple texteditor for the moment, just to get to
> > > know PHP-GTK.
> > > Normally it should be finished soon.
> > > Can I send it to you then, I will comment it well so people can use it
> > > as a tutorial
> >
> > Please could you submit it to the docs list (php-gtk-doc@lists.php.net)
> > where everyone concerned can see it?
> >
> > If we can't use it in the manual tutorials section, we can
> always move it to
> > the Wiki if that's ok with you. Don't worry, it'll get used :)
> >
> > Thanks!
> >
> > - Steph
>
> --
> PHP-GTK General Mailing List (http://gtk.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>