Re: [gtk-list] ScrolledWindow in GTK--



Angel Jimenez Jimenez <ajimenez@vnet.es> writes:
>  Can I remove an object from a ScrolledWindow? Every time I try, I get
> the following message:
> 
> ** WARNING **: file gtkcontainer.c: line 359 (gtk_container_remove):
> "widget->parent == GTK_WIDGET (container)"
> 
>  This is the relevant part of the source:
> 
> ----
> 
>   if ( ptTree )
>   {
>     ptScrolledWnd->remove (ptTree);
>     delete ptTree;
>   }

are you sure ptTree was initialized to zero. Maybe ptTree pointer is
messed up..

The problem that gtk is giving means that the object you're trying to
remove from the container has not been inserted to your scrolledwindow.
(== its parent is not scrolledwindow... => you cannot add same object
to more than one container..)

>   ptTree = new TRTSceneTree (ptScene);
>   assert ( ptTree );
>   ptTree->show();
> 
>   ptScrolledWnd->add (ptTree);
> 
> ----
> 
>  I destroy the previous tree (TRTSceneTree inherits from Gtk_Tree), and
> create a new one. It was working when I was adding/removing the tree
> directly to/from the VBox.

Does it say the message only first time, or every time you go there or
always except the first time?

-- 
-- Tero Pulkkinen -- terop@modeemi.cs.tut.fi --



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