On Sun, 29 May 2016 20:20:23 GMT, dan hitt wrote:

Under what circumstances does a DrawingArea know its parent?

That is, suppose you have code like this:

  import gtk.DrawingArea;
  class My_Class : DrawingArea {
    this(  ) {
      super( );
      // other stuff
    }
    void query( ) {
      Widget parent = this.getParent( );
      // do something with parent
   }
  }
  auto my_object = new My_Class( .... );
  Box b = get_from_glade_somehow( );
  b.add(my_object);
  containing_window.show( );
  my_object.query( );

Would you expect the getParent( ) call to return something non-null?

The reason i'm asking is i'm trying to debug something, and it would be handy to take a look at the parent.

However, the parent from getParent( ) is showing up as null.

I think that might be ok, as this is what happens in Oldrich Smehlik's gPolynomial app (hosted on github) in his Plot class.

OK, so i was totally mistaken here :(

In Oldrich's code the parent certainly is not null, and it was not in my imitation code either, but i got my test results inverted.

So sorry for the noise!

dan