Re: Underlying object missing?
| From: | Markus Fischer | Date: | Tue, 05 Feb 2002 19:36:24 +0000 |
| Subject: | Re: Underlying object missing? | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-1147@lists.php.net to get a copy of this message | ||
You have to call the base class constructor explicitely, e.g.
parent::GtkWindow();
On Tue, Feb 05, 2002 at 02:15:35PM -0500, Bryan Clark wrote :
> I'm trying to create a window class derived from GtkWindow so that
> creating a new instance of the derived class immediately shows it and
> its children. Here's the first part of the constructor:
>
> function MainDisplay()
> {
> // Member initialization
> $this->m_bRefresh = new GtkButton("Refresh List");
> $this->m_bExit = new GtkButton("Quit");
> $this->m_vbox = new GtkVBox(false, 5);
> $this->m_list = new GtkCList(3);
>
> print_r($this);
> print_r(get_class_methods($this));
>
> // Set the border width
> $this->set_border_width(10);
>
> // And so on and so forth .....
> }
>
> The assignments succeed, and the two print_r() statements show both that
> the member objects were instantiated and that $this inherited the
> GtkWindow methods as it was supposed to. However, the set_border_width()
> call results in the following message:
>
> <b>Fatal error</b>: Underlying object missing in
> <b>/home/bclark/pairs_userlist.php</b> on line <b>50</b><br>
>
> What's the "underlying object" supposed to be, and where did it go?
> Incidentally, there's no error when I create a GtkWindow directly --
> only when I try to derive from it.
>
> Any ideas on this one? Thanks.
> --
> Bryan A. Clark
> http://furless.sytes.net
>
>
> --
> PHP-GTK General Mailing List (http://gtk.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--
Please always Cc to me when replying to me on the lists.