Hi,
I'm quite new to gtksharp. I have a menu which i want to update in response
of some event.
The first 6 items must always remain there, then i have to append some
menuitems which
change at each call to this method.
Here is the code that i have at the moment.
The variable gomenu is the menu to be modified.
void UpdateGoToHistoryMenu()
{
// first i need to uderstand how to remove the previously added menuitems
// because otherwise i will continue to add
elements.
// Here i want to remove the menuitems from 7 to
end. How do i do this?
// then i can add elements
System.Collections.Generic.List<string> hist = history.GetElements();
for ( int i=0; i < hist.Count - 1; i++ )
{
ImageMenuItem item = new ImageMenuItem( hist[i] ){
Image = new Image(Stock.Directory, IconSize.Menu )};
gomenu.Insert(item, 6);
item.Show();
}
}
Basically i want to remove the menuitems from index 6 to the end of the
menu.
Cheers,
Davide
_______________________________________________
Gtk-sharp-list maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list