I have created a menu on a menubar using stetic within Monodevelop, and want to generate the menu items to be displayed when the menu is activated. Here is the code I have for the method:
protected virtual void OnSelectActionActivated (object sender, System.EventArgs e) { Gtk.Action act = sender as Gtk.Action; // get menu item associated with the drop-down menu Widget[] w = act.Proxies; MenuItem mi = w[0] as MenuItem; // get the dropdown menu Menu menu = mi.Submenu as Menu; // delete the menu items already in the menu foreach(Widget wid in menu.Children) { wid.Destroy(); } // create new menuitem MenuItem miB = new MenuItem("Background"); // add to menu menu.Add(miB); } When I click on the menu, this code is activated but no dropdown menu appears. If I look at the number of menu items in the menu before destroying the widgets, there are two the first time through (a TearOffMenuItem and a MenuItem which displays "Empty") and one each additional time through method. What am I missing? _______________________________________________ Gtk-sharp-list maillist - Gtk-sharp-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/gtk-sharp-list