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


C# MenuItem.Show方法代码示例

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


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

示例1: Initialize

 public override void Initialize()
 {
     itemInsert = new Gtk.MenuItem(Catalog.GetString("Insert checkbox"));
     itemInsert.Activated += OnMenuItemActivatedUnmarked;
     itemInsert.Show();
     AddPluginMenuItem(itemInsert);
     itemMarked = new Gtk.MenuItem(Catalog.GetString("Insert marked checkbox"));
     itemMarked.Activated += OnMenuItemActivatedMarked;
     itemMarked.Show();
     AddPluginMenuItem(itemMarked);
     itemXMarked = new Gtk.MenuItem(Catalog.GetString("Insert X marked checkbox"));
     itemXMarked.Activated += OnMenuItemActivatedXMarked;
     itemXMarked.Show();
     AddPluginMenuItem(itemXMarked);
     itemTick = new Gtk.MenuItem(Catalog.GetString("Insert tick"));
     itemTick.Activated += OnMenuItemActivatedTick;
     itemTick.Show();
     AddPluginMenuItem(itemTick);
     itemBallot = new Gtk.MenuItem(Catalog.GetString("Insert X ballot"));
     itemBallot.Activated += OnMenuItemActivatedBallotX;
     itemBallot.Show();
     AddPluginMenuItem(itemBallot);
     itemToggle = new Gtk.MenuItem(Catalog.GetString("Toggle checkmark"));
     itemToggle.Activated += OnMenuItemActivatedToggle;
     AddPluginMenuItem(itemToggle);
     Gtk.AccelGroup accel_group = new Gtk.AccelGroup();
     Window.AddAccelGroup(accel_group);
     itemToggle.AddAccelerator("activate", accel_group,
                               new AccelKey(Gdk.Key.m,
                                            Gdk.ModifierType.ControlMask,
                                            AccelFlags.Visible));
     itemToggle.Show();
 }
开发者ID:pacoqueen,项目名称:tomboy-checkmark,代码行数:33,代码来源:Checkmark.cs

示例2: PlayListTreeView

        public PlayListTreeView()
        {
            this.HeadersVisible = false;

            ls = new ListStore(typeof(PlayListPlay));
            this.Model = ls;

            menu = new Menu();
            MenuItem title = new MenuItem(Catalog.GetString("Edit Title"));
            title.Activated += new EventHandler(OnTitle);
            title.Show();
            MenuItem delete = new MenuItem(Catalog.GetString("Delete"));
            delete.Activated += new EventHandler(OnDelete);
            delete.Show();
            setRate = new MenuItem(Catalog.GetString("Apply current play rate"));
            setRate.Activated += new EventHandler(OnApplyRate);
            setRate.Show();
            menu.Append(title);
            menu.Append(setRate);
            menu.Append(delete);

            Gtk.TreeViewColumn nameColumn = new Gtk.TreeViewColumn();
            nameColumn.Title = Catalog.GetString("Name");
            Gtk.CellRendererText nameCell = new Gtk.CellRendererText();
            nameColumn.PackStart(nameCell, true);
            nameColumn.SetCellDataFunc(nameCell, new Gtk.TreeCellDataFunc(RenderName));
            this.AppendColumn(nameColumn);
        }
开发者ID:dineshkummarc,项目名称:longomatch,代码行数:28,代码来源:PlayListTreeView.cs

示例3: MakeMenuItem

	public static void MakeMenuItem (Gtk.Menu menu, string l, EventHandler e, bool enabled)
	{
		Gtk.MenuItem i = new Gtk.MenuItem (l);
		i.Activated += e;
                i.Sensitive = enabled;

		menu.Append (i);
		i.Show ();
	}
开发者ID:emtees,项目名称:old-code,代码行数:9,代码来源:Util.cs

示例4: Initialize

		public void Initialize ()
		{
			MenuItem deleteItem = new MenuItem ("Remove");
			deleteItem.Activated += new EventHandler (deleteItem_OnActivated);
			deleteItem.Show ();
			contextMenu.Add (deleteItem);
			MenuItem propertiesItem = new MenuItem ("Properties");
			propertiesItem.Activated += new EventHandler (propertiesItem_OnActivated);
			propertiesItem.Show ();
			contextMenu.Add (propertiesItem);
		}
开发者ID:segaman,项目名称:monodevelop,代码行数:11,代码来源:ContextMenu.cs

示例5: AddItem

        public Gtk.MenuItem AddItem(string label, EventHandler ev)
        {
            Gtk.MenuItem item = new Gtk.MenuItem (label);
            Append (item);

            if (ev != null)
                item.Activated += ev;

            item.Show ();

            return item;
        }
开发者ID:GNOME,项目名称:mistelix,代码行数:12,代码来源:ExtendedMenu.cs

示例6: Initialize

        public override void Initialize()
        {
            itemBack = new Gtk.MenuItem(Catalog.GetString("Back to previous version of this note."));
            itemBack.Activated += OnMenuBackActivated;
            itemBack.Show();
            AddPluginMenuItem(itemBack);

            itemFwd = new Gtk.MenuItem(Catalog.GetString("Forward to a later version of this note."));
            itemFwd.Activated += OnMenuFwdActivated;
            itemFwd.Show();
            AddPluginMenuItem(itemFwd);
        }
开发者ID:pacoqueen,项目名称:tomboy-versioning,代码行数:12,代码来源:Versioning.cs

示例7: TextViewPopulatePopup

		void TextViewPopulatePopup (object o, PopulatePopupArgs args)
		{
			MenuItem item = new MenuItem (GettextCatalog.GetString ("Clear"));
			SeparatorMenuItem sep = new SeparatorMenuItem ();
			
			item.Activated += ClearActivated;
			item.Show ();
			sep.Show ();
			
			args.Menu.Add (sep);
			args.Menu.Add (item);
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:12,代码来源:ConsoleView.cs

示例8: InterfaceInitialize

 protected override void InterfaceInitialize()
 {
     viewMenu = (Globals.ActionManager.GetWidget("/MainMenu/ViewMenu") as MenuItem).Submenu as Menu;
     menuItem = new MenuItem(Catalog.GetString("Mini mode"));
     menuItem.Activated += delegate {
         if (mini_mode == null)
             mini_mode =  new MiniMode();
         mini_mode.Show();
     };
     viewMenu.Insert(menuItem, 2);
     menuItem.Show();
 }
开发者ID:jrmuizel,项目名称:banshee-unofficial-plugins,代码行数:12,代码来源:MiniModePlugin.cs

示例9: Initialize

        public override void Initialize()
        {
            Assembly asm = Assembly.GetExecutingAssembly();
            string asm_dir = System.IO.Path.GetDirectoryName(asm.Location);

            // if there are no xsl files - copy all xsl file resources to folder
            string[] xslFiles = System.IO.Directory.GetFiles(asm_dir, "CopyAs-*.xsl");
            if (xslFiles.Length == 0) {
                // copy initial files to add-in dir
                foreach (string xslFile in initialXslFiles) {
                    Stream resource = asm.GetManifestResourceStream(xslFile);
                    Stream dest = new FileStream(Path.Combine(asm_dir, xslFile),
                            FileMode.OpenOrCreate, FileAccess.Write);

                    byte[] buf = new byte[4096];
                    while (true) {
                        int n = resource.Read(buf, 0, buf.Length);
                        if (n == 0) {
                            break;
                        }
                        dest.Write(buf, 0, n);
                    }
                    dest.Close();
                }
                // list copied files
                xslFiles = System.IO.Directory.GetFiles(asm_dir, "CopyAs-*.xsl");
            }

            Menu menu = new Menu();
            foreach (string xslFile in xslFiles) {
                if (mainItem == null) {
                    mainItem = new Gtk.MenuItem(Catalog.GetString("Copy as"));
                    mainItem.Show();
             					AddPluginMenuItem(mainItem);
                    mainItem.Submenu = menu;
                }
                string menuName = xslFile.Substring(xslFile.IndexOf("-") + 1);
                menuName = menuName.Substring(0, menuName.Length - 4);
                       		MenuItem subItem = new Gtk.MenuItem(Catalog.GetString(menuName));
                subItem.Show();
                            subItem.Activated += OnMenuItemActivated;
                menu.Append(subItem);

                string stylesheet_file = Path.Combine(asm_dir, xslFile);
                XslTransform xsl = new XslTransform();
                xsl.Load(stylesheet_file);
                transformByMenuItem.Add(subItem, xsl);
            }
        }
开发者ID:brwright321,项目名称:tomboy-copy-as,代码行数:49,代码来源:CopyAs.cs

示例10: MenuItem

        void IExtensionService.Initialize()
        {
            action_service = ServiceManager.Get<InterfaceActionService> ();

            viewMenu = (action_service.UIManager.GetWidget ("/MainMenu/ViewMenu") as MenuItem).Submenu as Menu;
            menuItem = new MenuItem (Catalog.GetString ("_Mini Mode"));
            menuItem.Activated += delegate {
                if (mini_mode == null) {
                    mini_mode = new MiniMode (ServiceManager.Get<GtkElementsService> ().PrimaryWindow);
                }

                ServiceManager.Get<GtkElementsService> ().PrimaryWindow = mini_mode;
                mini_mode.Enable ();
            };
            viewMenu.Insert (menuItem, 2);
            menuItem.Show ();
        }
开发者ID:haugjan,项目名称:banshee-hacks,代码行数:17,代码来源:MiniModeService.cs

示例11: Initialize

		public override void Initialize ()
		{
			separator = new Gtk.SeparatorToolItem ();
			separator.Show ();
			
			record_button = new Gtk.ToolButton (Gtk.Stock.MediaRecord);
			record_button.Clicked += OnRecordButtonClicked;
			record_button.Show ();

			play_button = new Gtk.ToolButton (Gtk.Stock.MediaPlay);
			play_button.Clicked += OnPlayButtonClicked;
			play_button.Show ();
			
			stop_button = new Gtk.ToolButton (Gtk.Stock.MediaStop);
			stop_button.Clicked += OnStopButtonClicked;
			stop_button.Show ();

			delete_item = new Gtk.MenuItem ("Delete Voice Note");
			delete_item.Activated += OnDeleteItemActivated;
			delete_item.Show ();
		
			initialize ();
		}
开发者ID:MichaelAquilina,项目名称:tomboy,代码行数:23,代码来源:VoiceNote.cs

示例12: CreateMenu_simple

 private void CreateMenu_simple(object o, Gtk.PopulatePopupArgs e)
 {
     try
     {
         Gtk.SeparatorMenuItem separator1 = new Gtk.SeparatorMenuItem();
         separator1.Show();
         e.Menu.Append(separator1);
         Gtk.Menu m0 = new Gtk.Menu();
         Gtk.MenuItem m1 = new Gtk.MenuItem("Transparency");
         m1.Submenu = m0;
         m1.Show();
         e.Menu.Append(m1);
         Gtk.MenuItem m2 = new Gtk.MenuItem("0%");
         m2.Activated += new EventHandler(toolStripMenuItem6_Click);
         Gtk.MenuItem m3 = new Gtk.MenuItem("20%");
         m3.Activated += new EventHandler(toolStripMenuItem5_Click);
         Gtk.MenuItem m4 = new Gtk.MenuItem("40%");
         m4.Activated += new EventHandler(toolStripMenuItem4_Click);
         Gtk.MenuItem m6 = new Gtk.MenuItem("80%");
         m6.Activated += new EventHandler(toolStripMenuItem2_Click);
         Gtk.MenuItem m5 = new Gtk.MenuItem("60%");
         m5.Activated += new EventHandler(toolStripMenuItem3_Click);
         Gtk.CheckMenuItem ma = new Gtk.CheckMenuItem("On top");
         ma.Active = OnTop;
         ma.Activated += new EventHandler(mx_Click);
         m0.Append(m2);
         m0.Append(m3);
         m0.Append(m4);
         m0.Append(m5);
         m0.Append(m6);
         m2.Show();
         m3.Show();
         m4.Show();
         m5.Show();
         m6.Show();
         ma.Show();
         e.Menu.Append(m1);
         e.Menu.Append(ma);
     }
     catch (Exception fail)
     {
         Core.handleException(fail);
     }
 }
开发者ID:JGunning,项目名称:OpenAIM,代码行数:44,代码来源:MicroChat.cs

示例13: CreateContextMenu

        public static Gtk.Menu CreateContextMenu(RemoveEntryFunc removeEntryFunc, ResourceEntry entry)
        {
            Gtk.Menu result = new Gtk.Menu ();
            Gtk.MenuItem item = new Gtk.MenuItem (GettextCatalog.GetString ("Delete"));
            item.Sensitive = true;
            item.Activated += delegate {
                removeEntryFunc (entry);
            };
            item.Show();
            result.Append (item);

            return result;
        }
开发者ID:mono-soc-2012,项目名称:ressource-md-addin,代码行数:13,代码来源:ResXEditorWidget.cs

示例14: TextViewPopulatePopup

        void TextViewPopulatePopup(object o, PopulatePopupArgs args)
        {
            MenuItem item = new MenuItem (GettextCatalog.GetString ("Clear"));
            SeparatorMenuItem sep = new SeparatorMenuItem ();

            item.Activated += ClearActivated;
            item.Show ();
            sep.Show ();

            args.Menu.Add (sep);
            args.Menu.Add (item);

            foreach (var menu_command in menuCommands)
            {
                var tmp = new MenuItem(menu_command.Item1);
                tmp.Activated += menu_command.Item2;
                tmp.Show();
                args.Menu.Add(tmp);
            }
        }
开发者ID:nerdshark,项目名称:CSharpReplAddin,代码行数:20,代码来源:ReplView.cs

示例15: DoPopUp

        private void DoPopUp()
        {
            Menu popup = new Menu();

            ImageMenuItem newItem = new ImageMenuItem (Stock.New, new Gtk.AccelGroup(IntPtr.Zero));
            newItem.Activated += new EventHandler (OnNewEntryActivate);
            newItem.Show ();
            popup.Append (newItem);

            MenuItem renameItem = new MenuItem ("Rename...");
            renameItem.Activated += new EventHandler (OnRenameActivate);
            renameItem.Show ();

            popup.Append (renameItem);

            MenuItem exportItem = new MenuItem ("Export...");
            exportItem.Activated += new EventHandler (OnExportActivate);
            exportItem.Show ();

            popup.Append (exportItem);

            ImageMenuItem deleteItem = new ImageMenuItem (Stock.Delete, new Gtk.AccelGroup(IntPtr.Zero));
            deleteItem.Activated += new EventHandler (OnDeleteActivate);
            deleteItem.Show ();

            popup.Append (deleteItem);

            popup.Popup(null, null, null, 3,
                    Gtk.Global.CurrentEventTime);
        }
开发者ID:MrJoe,项目名称:lat,代码行数:30,代码来源:LdapTreeView.cs


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