本文整理汇总了C#中Gtk.MenuItem.Add方法的典型用法代码示例。如果您正苦于以下问题:C# MenuItem.Add方法的具体用法?C# MenuItem.Add怎么用?C# MenuItem.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.MenuItem
的用法示例。
在下文中一共展示了MenuItem.Add方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PlayerMenu
public PlayerMenu()
{
playerMenu = new Menu ();
addToPlaylistMenu = new MenuItem ("");
playerMenu.Add (addToPlaylistMenu);
exportToVideoFile = new MenuItem ("");
exportToVideoFile.Add (exportToVideoFile);
}
示例2: BuildMenu
private void BuildMenu()
{
var accelGroup = new Gtk.AccelGroup();
// File
this.miFile = new Gtk.MenuItem( "_File" );
this.mFile = new Gtk.Menu();
this.miFile.Submenu = this.mFile;
var opOpen = this.actOpen.CreateMenuItem();
opOpen.AddAccelerator( "activate", accelGroup, new Gtk.AccelKey(
Gdk.Key.o, Gdk.ModifierType.ControlMask, Gtk.AccelFlags.Visible) );
var opQuit = this.actQuit.CreateMenuItem();
opQuit.AddAccelerator( "activate", accelGroup, new Gtk.AccelKey(
Gdk.Key.q, Gdk.ModifierType.ControlMask, Gtk.AccelFlags.Visible) );
miFile.Add( opOpen );
miFile.Add( this.actClose.CreateMenuItem() );
miFile.Add( new Gtk.SeparatorMenuItem() );
miFile.Add( opQuit );
// View
this.miView = new Gtk.MenuItem( "_View" );
this.mView = new Gtk.Menu();
this.miView.Submenu = this.mView;
var opViewToolbar = this.actViewToolbar.CreateMenuItem();
var opForward = this.actForward.CreateMenuItem();
opForward.AddAccelerator( "activate", accelGroup, new Gtk.AccelKey(
Gdk.Key.Page_Down, Gdk.ModifierType.None, Gtk.AccelFlags.Visible) );
var opBackward = this.actBack.CreateMenuItem();
opForward.AddAccelerator( "activate", accelGroup, new Gtk.AccelKey(
Gdk.Key.Page_Up, Gdk.ModifierType.None, Gtk.AccelFlags.Visible) );
var opRewind = this.actRewind.CreateMenuItem();
opRewind.AddAccelerator( "activate", accelGroup, new Gtk.AccelKey(
Gdk.Key.Page_Up, Gdk.ModifierType.ControlMask, Gtk.AccelFlags.Visible) );
var opGotoLast = this.actGoToEnd.CreateMenuItem();
opGotoLast.AddAccelerator( "activate", accelGroup, new Gtk.AccelKey(
Gdk.Key.Page_Down, Gdk.ModifierType.ControlMask, Gtk.AccelFlags.Visible) );
var opGo = this.actGoTo.CreateMenuItem();
opGo.AddAccelerator( "activate", accelGroup, new Gtk.AccelKey(
Gdk.Key.g, Gdk.ModifierType.ControlMask, Gtk.AccelFlags.Visible) );
var opFind = this.actFind.CreateMenuItem();
opFind.AddAccelerator( "activate", accelGroup, new Gtk.AccelKey(
Gdk.Key.f, Gdk.ModifierType.ControlMask, Gtk.AccelFlags.Visible) );
this.mView.Add( opViewToolbar );
this.mView.Add( opForward );
this.mView.Add( opBackward );
this.mView.Add( opRewind );
this.mView.Add( opGotoLast );
this.mView.Add( opGo );
this.mView.Add( new Gtk.SeparatorMenuItem() );
this.mView.Add( opFind );
// Help
this.miHelp = new Gtk.MenuItem( "_Help" );
this.mHelp = new Gtk.Menu();
this.miHelp.Submenu = this.mHelp;
this.mHelp.Add( this.actAbout.CreateMenuItem() );
// Menu bar
this.mbMenuBar = new Gtk.MenuBar();
this.mbMenuBar.Add( miFile );
this.mbMenuBar.Add( miView );
this.mbMenuBar.Add( miHelp );
this.AddAccelGroup( accelGroup );
}