Re: Underlying object missing?
| From: | Rich Payne | Date: | Wed, 06 Feb 2002 01:05:19 +0000 |
| Subject: | Re: Underlying object missing? | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-1150@lists.php.net to get a copy of this message | ||
The underlying object is the GtkWindow itself. You haven't posted all the
code here so it's hard to tell, but my guess would be that you are not
calling the parent's constructor. So, your code should look something
like:
Class MyWindow extends GtkWindow {
$this->GtkWindow();
function MainDisplay() {
......
}
}
PHP doesn't do this for you so you need to do it manually.
hope this helps,
--rdp
On Tue, 5 Feb 2002, 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.
>
--
Rich Payne
http://talisman.mv.com