本文整理汇总了C#中Gtk.MenuBar.ShowAll方法的典型用法代码示例。如果您正苦于以下问题:C# MenuBar.ShowAll方法的具体用法?C# MenuBar.ShowAll怎么用?C# MenuBar.ShowAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.MenuBar
的用法示例。
在下文中一共展示了MenuBar.ShowAll方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateMenus
Gtk.MenuBar CreateMenus ()
{
AccelGroup group = new AccelGroup ();
MenuBar bar = new MenuBar ();
Menu file_menu = new Menu ();
MenuItem file_menu_item = new MenuItem ("_File");
file_menu_item.Submenu = file_menu;
ImageMenuItem file_exit = new ImageMenuItem (Gtk.Stock.Quit, group);
file_exit.Activated += new EventHandler (exit_cb);
file_menu.Append (file_exit);
bar.Append (file_menu_item);
Menu help_menu = new Menu ();
ImageMenuItem help_menu_item = new ImageMenuItem (Gtk.Stock.Help, group);
help_menu_item.Submenu = help_menu;
ImageMenuItem file_help = new ImageMenuItem (Gnome.Stock.About, group);
file_help.Activated += new EventHandler (about_cb);
help_menu.Append (file_help);
bar.Append (help_menu_item);
bar.ShowAll ();
return bar;
}
示例2: MainMenu
//------------------------------------------------------------------------------
public MainMenu()
{
uim = new Gtk.UIManager ();
Gtk.ActionGroup actions = new Gtk.ActionGroup ("MenuBarActions" + Guid.NewGuid ());
actions.Add (getActionEntries ());
uim.InsertActionGroup (actions, 0);
// Put the XML definition of the controls (widgets) into the UIManager's buffer -and- create controls (widgets).
uim.AddUiFromString (UI.ToString ());
instance = (Gtk.MenuBar)uim.GetWidget ("/menubar");
instance.ShowAll ();
}
示例3: CreateMenuBar
void CreateMenuBar()
{
topMenu = new Gtk.MenuBar();
Menu fileMenu = new Menu();
MenuItem file = new MenuItem("File");
file.Submenu = fileMenu;
AccelGroup agr = new AccelGroup();
AddAccelGroup(agr);
ImageMenuItem exit = new ImageMenuItem(Stock.Quit, agr);
exit.AddAccelerator("activate", agr, new AccelKey(Gdk.Key.q, Gdk.ModifierType.ControlMask, AccelFlags.Visible));
exit.Activated += onButtonPressEvent;
fileMenu.Append(exit);
topMenu.Append(file);
((VBox)fullViewVBox).PackStart (topMenu, false, false, 0);
((Gtk.Box.BoxChild) fullViewVBox [topMenu]).Position = 0;
topMenu.ShowAll ();
}