当前位置: 首页>>代码示例>>C#>>正文


C# MenuItem.Add方法代码示例

本文整理汇总了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);
 }
开发者ID:LongoMatch,项目名称:longomatch,代码行数:8,代码来源:PlayerMenu.cs

示例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 );
        }
开发者ID:Baltasarq,项目名称:Visor,代码行数:75,代码来源:Gui.cs


注:本文中的Gtk.MenuItem.Add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。