[Gtk-sharp-list] VBox in a ScrollWindow?

Adam Tauno Williams awilliam at whitemice.org
Sun Apr 9 12:07:07 EDT 2006


I create a scrolledWindow and add a VBox as the child.

annotations = new VBox();
scrollArea = new ScrolledWindow();
scrollArea.AddWithViewport(annotations);
scrollArea.HscrollbarPolicy = PolicyType.Automatic;
scrollArea.VscrollbarPolicy = PolicyType.Always;
scrollArea.WidthRequest = 550;

Then I need to be able to remove all widgets from the VBox and add
widgets.

To remove all widgets -
foreach(Widget widget in annotations.AllChildren)
		annotations.Remove(widget);

To add a widgets -
TaskAnnotation widget = new TaskAnnotation();
...
if(annotations.Children.Length > 0)
	annotations.PackEnd(new HSeparator(), true, true, 2);
annotations.PackEnd(widget, false, true, 2);

Yet widgets are not removed from the VBox when the first code is ran,
and when viewed the added widgets appears but *NOT* in the scrolled
window area; the widgets appear to added to the bottom of the contents
of the window (which itself contains a VBox). 




More information about the Gtk-sharp-list mailing list