Re: Object Oriented signal handlers?
| From: | Rich Payne | Date: | Mon, 27 Jan 2003 19:31:22 +0000 |
| Subject: | Re: Object Oriented signal handlers? | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-2971@lists.php.net to get a copy of this message | ||
On Mon, 27 Jan 2003, Benjamin Smith wrote:
> I'm doing a project of medium size, and would like to break out my widgets
> and signal handlers into objects.
>
> I've figured out how to pass around the objects and widgets pretty nicely,
> but have so far been stumped as to how to call object-oriented signal
> handlers. Is there a way to do so, or do I just have to use a naming
> convention (and remember said names, thus fixing my object names) to make
> this work?
>
> For example: (pseudo-code)
>
> <?php
>
> Class Handle_Login
> {
> Function Handle_Login()
> {
> $this->Prompt();
> }
>
> Function Prompt() {
> $this->login_window=&New GtkWindow();
> // THIS IS WHERE I HAVE TROUBLE - Any ideas?
> $this->login_window->Connect('destroy', 'this->close',
> $this->login_window);
How about this?
$window = $this->login_window;
$window->connect('destroy', array(&$this,'close'), $window);
--rdp
Rich Payne
http://talisman.mv.com
rdp at talisman dot mv dot com