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


C# Gtk.MenuItem类代码示例

本文整理汇总了C#中Gtk.MenuItem的典型用法代码示例。如果您正苦于以下问题:C# Gtk.MenuItem类的具体用法?C# Gtk.MenuItem怎么用?C# Gtk.MenuItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Gtk.MenuItem类属于命名空间,在下文中一共展示了Gtk.MenuItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BuildMenu

        private void BuildMenu()
        {
            var menuBar = new Gtk.MenuBar();
            var miFile = new Gtk.MenuItem( "File" );
            var mFile = new Gtk.Menu();
            var miHelp = new Gtk.MenuItem( "Help" );
            var mHelp = new Gtk.Menu();
            var miView = new Gtk.MenuItem( "View" );
            var mView = new Gtk.Menu();

            miFile.Submenu = mFile;
            mFile.Append( this.actQuit.CreateMenuItem() );
            miHelp.Submenu = mHelp;
            mHelp.Append( this.actAbout.CreateMenuItem() );
            miView.Submenu = mView;
            mView.Append( this.actViewBoxes.CreateMenuItem() );
            mView.Append( this.actViewFrames.CreateMenuItem() );
            mView.Append( this.actViewNotebook.CreateMenuItem() );
            mView.Append( this.actViewDrawing.CreateMenuItem() );

            menuBar.Append( miFile );
            menuBar.Append( miView );
            menuBar.Append( miHelp );
            this.vbMain.PackStart( menuBar, false, false, 5 );
        }
开发者ID:Baltasarq,项目名称:GTKSharpDemo,代码行数:25,代码来源:MainWindowView.cs

示例2: UpdateMenu

		void UpdateMenu ()
		{
			//
			// Clear out the old list
			//
			foreach (Gtk.MenuItem old_item in menu.Children) {
				menu.Remove (old_item);
			}

			//
			// Build a new list
			//
			foreach (BacklinkMenuItem item in GetBacklinkMenuItems ()) {
				item.ShowAll ();
				menu.Append (item);
			}

			// If nothing was found, add in a "dummy" item
			if (menu.Children.Length == 0) {
				// This is a disabled placeholder item for an empty menu
				Gtk.MenuItem blank_item = new Gtk.MenuItem (Catalog.GetString ("(none)"));
				blank_item.Sensitive = false;
				blank_item.ShowAll ();
				menu.Append (blank_item);
			}

			submenu_built = true;
		}
开发者ID:MichaelAquilina,项目名称:tomboy,代码行数:28,代码来源:BacklinksNoteAddin.cs

示例3: SetupUi

		protected void SetupUi()
		{
			var box = new Gtk.VBox();

			var menu = new Gtk.MenuBar();
			var fileMenu = new Gtk.Menu();
			var file = new Gtk.MenuItem("File");
			file.Submenu = fileMenu;
			menu.Append(file);

			var save = new Gtk.MenuItem("Save");
			save.Activated += OnSaveMenuActivated;
			var load = new Gtk.MenuItem("Load");
			load.Activated += OnLoadMenuActivated;

			var exit = new Gtk.MenuItem("Exit");
			exit.Activated += (sender, e) => Gtk.Application.Quit();

			fileMenu.Append(save);
			fileMenu.Append(load);
			fileMenu.Append(exit);


			box.PackStart(menu, false, false, 0);

			nb = new Gtk.Notebook();
			nb.ShowTabs = false;
			nb.AppendPage(SetupOverviewPage(), new Gtk.Label("Overview"));
			nb.AppendPage(SetupNewNotePage(), new Gtk.Label("New"));
			box.PackStart(nb, true, true, 2);

			Add(box);
		}
开发者ID:cgt,项目名称:Notes,代码行数:33,代码来源:MainWindow.cs

示例4: GameDBPlugin

            public GameDBPlugin()
                : base("gamedb",
						     Catalog.
						     GetString
						     ("Games Database Plugin"),
						     Catalog.
						     GetString
						     ("Game database"))
            {
                saveItem = new MenuItem (Catalog.
                             GetString
                             ("Add Games to _Database"));
                saveItem.Activated += on_add_to_db_activate;
                saveItem.Show ();

                /*
                   openDbItem = new MenuItem (Catalog.
                   GetString
                   ("Games _Database"));

                   openDbItem.Activated +=
                   on_open_games_db_activate;
                   openDbItem.Show ();
                 */
            }
开发者ID:BackupTheBerlios,项目名称:csboard-svn,代码行数:25,代码来源:GameDbPlugin.cs

示例5: AddMenuItem

        /// <summary>
        /// Adds Gtk.MenuItem to Gtk.Menu.
        /// </summary>
        /// <param name="menu">Gtk.Menu object.</param>
        /// <param name="label">Menu item label.</param>
        /// <param name="atEnd">Whether item will be added to begining or end of menu.</param>
        /// <param name="handler">Activated event handler.</param>		
        /// <param name="sensitive">Whether item is sensitive.</param>
        public static Gtk.MenuItem AddMenuItem(this Gtk.Menu menu, string label, bool atEnd = true, System.EventHandler handler = null, bool sensitive = true)
        {
            Gtk.MenuItem menuitem = new Gtk.MenuItem(label);
            menu.AddWidget(menuitem, atEnd, handler);
            menuitem.Sensitive = sensitive;

            return menuitem;
        }
开发者ID:quequotion,项目名称:glippy,代码行数:16,代码来源:Extensions.cs

示例6: GetMenuItem

		public override Gtk.MenuItem GetMenuItem ()
		{
			if (item == null) {
				item = new Gtk.MenuItem (_label != null ? Catalog.GetString (_label) : Id);
				item.Activated += OnActivated;
			}
			return item;
		}
开发者ID:AminBonyadUni,项目名称:facedetect-f-spot,代码行数:8,代码来源:MenuNode.cs

示例7: GetMenuItem

		public override Gtk.MenuItem GetMenuItem ()
		{
			Gtk.MenuItem it = new Gtk.MenuItem (label);
			Gtk.Menu submenu = new Gtk.Menu ();
			foreach (MenuNode node in ChildNodes)
				submenu.Insert (node.GetMenuItem (), -1);
			it.Submenu = submenu;
			return it;
		}
开发者ID:wanglehui,项目名称:mono-addins,代码行数:9,代码来源:SubmenuNode.cs

示例8: Hook_Initialise

 public override void Hook_Initialise(Forms.Main main)
 {
     menu = new Gtk.MenuItem("Display ignored text");
     collector = new Graphics.Window();
     collector.CreateChat(null, false, false, false);
     menu.Activated += new EventHandler(Display);
     collector.WindowName = "Ignored";
     main.ToolsMenu.Append(menu);
     menu.Show();
 }
开发者ID:JGunning,项目名称:OpenAIM,代码行数:10,代码来源:Class.cs

示例9: GetMenuItem

		public override Gtk.MenuItem GetMenuItem ()
		{
			Gtk.MenuItem item;
			if (icon != null)
				item = new Gtk.ImageMenuItem (icon, accelGroup);
			else
				item = new Gtk.MenuItem (label);
			item.Activated += OnClicked;
			return item;
		}
开发者ID:wanglehui,项目名称:mono-addins,代码行数:10,代码来源:MenuItemNode.cs

示例10: OnNoteOpened

        public override void OnNoteOpened()
        {
            // Add the menu item when the window is created.
            menu_item = new Gtk.MenuItem (
                Catalog.GetString ("Note Statistics"));

            menu_item.Activated += OnMenuItemActivated;

            menu_item.Show ();
            AddPluginMenuItem (menu_item);
        }
开发者ID:eeejay,项目名称:tomboy-notestats,代码行数:11,代码来源:NoteStatisticsAddin.cs

示例11: Hook_Initialise

 public override void Hook_Initialise(Forms.Main main)
 {
     _m = main;
     item = new Gtk.MenuItem("#pidgeon");
     item.Activated += new EventHandler(pidgeonToolStripMenuItem_Click);
     separator = new Gtk.SeparatorMenuItem();
     main.HelpMenu.Append(separator);
     main.HelpMenu.Append(item);
     separator.Show();
     item.Show();
     Core.DebugLog("Registered #pidgeon in menu");
 }
开发者ID:JGunning,项目名称:OpenAIM,代码行数:12,代码来源:Channel.cs

示例12: OnNoteOpened

 public override void OnNoteOpened()
 {
     if (this.Note.Title.StartsWith("GTD")) {
         item = new Gtk.MenuItem("Update Tasks");
         item.Activated += OnMenuItemActivated;
         item.AddAccelerator ("activate", Window.AccelGroup,
             (uint) Gdk.Key.d, Gdk.ModifierType.ControlMask,
             Gtk.AccelFlags.Visible);
         item.Show ();
         AddPluginMenuItem (item);
     }
 }
开发者ID:aleneum,项目名称:tomboy-addin-task,代码行数:12,代码来源:TomboyTaskNoteAddin.cs

示例13: Create

        public static void Create(Tag [] tags, Gtk.Menu menu)
        {
            var findWithString = Catalog.GetPluralString ("Find _With", "Find _With", tags.Length);
            var item = new Gtk.MenuItem (String.Format (findWithString, tags.Length));

            Gtk.Menu submenu = GetSubmenu (tags);
            if (submenu == null)
                item.Sensitive = false;
            else
                item.Submenu = submenu;

            menu.Append (item);
            item.Show ();
        }
开发者ID:Yetangitu,项目名称:f-spot,代码行数:14,代码来源:TermMenuItem.cs

示例14: Hook_BeforeTextMenu

 public override void Hook_BeforeTextMenu(Extension.ScrollbackArgs Args)
 {
     text = Args.scrollback.SelectedText;
     Gtk.SeparatorMenuItem xx = new Gtk.SeparatorMenuItem();
     xx.Show();
     Args.menu.Add(xx);
     Gtk.MenuItem wiki = new Gtk.MenuItem("Search using wiki");
     wiki.Activated += new EventHandler(SearchWiki);
     wiki.Show();
     Args.menu.Add(wiki);
     Gtk.MenuItem goog = new Gtk.MenuItem("Search using google");
     goog.Show();
     goog.Activated += new EventHandler(SearchGoogle);
     Args.menu.Add(goog);
 }
开发者ID:JGunning,项目名称:OpenAIM,代码行数:15,代码来源:Search.cs

示例15: OnNoteOpened

		public override void OnNoteOpened ()
		{
			// Add the menu item when the window is created
			item = new Gtk.MenuItem (
				Catalog.GetString ("Insert Timestamp"));
			item.Activated += OnMenuItemActivated;
			item.AddAccelerator ("activate", Window.AccelGroup,
				(uint) Gdk.Key.d, Gdk.ModifierType.ControlMask,
				Gtk.AccelFlags.Visible);
			item.Show ();
			AddPluginMenuItem (item);

			// Get the format from GConf and subscribe to changes
			date_format = (string) Preferences.Get (
				Preferences.INSERT_TIMESTAMP_FORMAT);
			Preferences.SettingChanged += OnFormatSettingChanged;
		}
开发者ID:MichaelAquilina,项目名称:tomboy,代码行数:17,代码来源:InsertTimestampNoteAddin.cs


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