child abondonment?



In my application, I have a Vbox which I attach a table.  The Vbox
contains various children, which are not really important for this
question.  When I attach the Vbox using gtk_table_attach_defaults(), its
parent pointer should be set to point to the table to which it was
attached, correct?  I have been able to confirm this by
gtk_widget_get_name(Vbox->parent);

However, later on in the program, the Vbox has its parent pointer set to
null!  I do not edit the Vbox in my code anywhere in between, so I
cannot tell where the value of Vbox->parent is changing.  Does anyone
know what could cause this?

my code looks something like this.  The vbox is attached in function1,
and function2 is intended to remove the vbox.

function1()
{
  ...
  new_vbox=function_which_creates_and_packs_the_vbox();
  gtk_table_attach_defaults(table, vbox, ...);  
  /* Here, I can confirm that vbox->parent==table */
}

function2()
{
  ...
  /* Here, src_widget is a child of the vbox refered to above.
   * lookup_widget is a function supplied by glade, which is
   * supposed to recurse from a widget up to its top-level 
   * parent window, and then find the widget whose name matches
   * the second argument.
   * This call reports that it cannot find the widget. 
   * I can see that the upward recursion through parent windows
   * stops when it hits the vbox.  By the time this function is
   * called, vbox->parent has been set to NULL
   */
  top_window=lookup_widget(src_widget, "WIDGET NAME");
  ...
}

thanks!
-Ron





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]