In Gtk#, why is my MenuToolItem not displaying its Menu?
I want to add a MenuToolItem
to my Toolbar. It contains two RadioMenuItem
s. However, when I click the drop-down arrow, I see this:
This is my current code:
MenuToolButton reviewModeToolButton =
new MenuToolButton (Stock.Preferences);
toolbar.Add (reviewModeToolButton);
Menu reviewModeMenu = new Menu ();
reviewModeToolButton.Menu = reviewModeMenu;
RadioMenuItem normalMenuItem = new RadioMenuItem ("Normal开发者_开发问答 Mode");
RadioMenuItem cramMenuItem =
new RadioMenuItem (normalMenuItem, "Cram Mode");
reviewModeMenu.Add (normalMenuItem);
reviewModeMenu.Add (cramMenuItem);
What am I doing wrong?
Add at the end:
reviewModeMenu.ShowAll ();
At default newly created widgets are not in visible state.
精彩评论