[Gtk-sharp-list] Problem with a ScrolledWindow
Dan Winship
danw at novell.com
Mon May 16 08:42:56 EDT 2005
On Mon, 2005-05-16 at 12:41 +0200, tapia wrote:
> Hi.
>
> I'm trying to switch some widgets in a ScrolledWindow. The idea is
> extract the child widget, and insert another one. The new one is a gecko
> WebControl, so I have to insert it with AddWithViewport.
>
> The result I have is an empty scrolledwindow, and the WebControl showing
> in another window!
>
> This is the code:
>
> itemShelf.Unparent ();
You don't want to be using Unparent(). Unparent() is an internal method
for use when implementing the OnRemoved method in a Gtk.Container
subclass. To remove a widget from its parent, call its parent's Remove()
method:
whateverItemShelfsParentIs.Remove (itemShelf);
or if you don't have a reference to its parent handy, you could do:
((Gtk.Container)itemShelf.Parent).Remove (itemShelf);
-- Dan
More information about the Gtk-sharp-list
mailing list