开发者

In Gtk#, why is my MenuToolItem not displaying its Menu?

I want to add a MenuToolItem to my Toolbar. It contains two RadioMenuItems. However, when I click the drop-down arrow, I see this:

In Gtk#, why is my MenuToolItem not displaying its Menu?

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜