Re: gtk--, gtk warning, Gtk_Text popping out of main wnd




Tero Pulkkinen <terop@students.cc.tut.fi> writes:

> Tom Fishwick <tfishwick@coastnet.com> writes:
> >         I've run into a couple of problems.  In my program I have a main
> > window
> > that has a notebook in it.  i've made my own notebook class deriving it
> > from Gtk_Notebook, and in it, theres a list of Gtk_Label pointers.  So
> > when I add pages to the notebook, its like this append_page(&txtMain,
> > &lbl) (done within the notebook class) , I get a warning (most of the
> > time)
> > 
> > ** WARNING **: file gtkwidget.c: line 2469 (gtk_widget_set_parent):
> > "widget->parent == NULL"
> 
> I think you need to realize() the notebo ok before adding things to it.

What the warning means is that you are trying to add a widget that
already was added one place (i.e., widget->parent is not NULL)
into another container.

Remember, that the warning really should be read:

  ** WARNING **: file gtkwidget.c: line 2469 (gtk_widget_set_parent):
     assertion "widget->parent == NULL" failed.

I don't think this one has anything to do with realization.

> > and I get two pages added with identical labels!  Could this be
> > happening because the Gtk_Labels don't know their parent (thats what the
> > warning seems to say?), cause there created in the notebook class I've
> > made?  Either way, any ideas on how to fix it would be nice :-).  I've
> > tried calling 'set_parent' but it didn't seem to do the trick.
> > 
> > My Second problem.  In my notebook class (derived from Gtk_Notebook)
> > when I do a 'remove_page(page)', the Gtk_Text accociated with the
> > notebook, pops out of the main window and floats.  
> 
> This sounds odd.

On the other hand, this one does have to do with realization.

This is typically a symptom that text is being added to a Text
widget before it is added to its parent. When text is added,
if the Text widget is not realized, it realizes itself. But
without a parent, the only place to create the widget's
X window is on the root window.

I really have no idea why the situation arises here, though.

Regards,
                              Owen



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