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


C# Gtk.Popup方法代码示例

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


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

示例1: Activate

        public void Activate(Gdk.EventButton eb, Literal literal, Gtk.Menu popupMenu, bool isPopup)
        {
            /*MenuItem attach_item = new MenuItem (Catalog.GetString ("Find With"));
            TagMenu attach_menu = new TagMenu (attach_item, App.Instance.Database.Tags);
            attach_menu.TagSelected += literal.HandleAttachTagCommand;
            attach_item.ShowAll ();
            popup_menu.Append (attach_item);*/

            if (literal.IsNegated) {
                GtkUtil.MakeMenuItem (popupMenu,
                              String.Format (Catalog.GetString ("Include Photos Tagged \"{0}\""), literal.Tag.Name),
                              new EventHandler (literal.HandleToggleNegatedCommand),
                              true);
            } else {
                GtkUtil.MakeMenuItem (popupMenu,
                              String.Format (Catalog.GetString ("Exclude Photos Tagged \"{0}\""), literal.Tag.Name),
                              new EventHandler (literal.HandleToggleNegatedCommand),
                              true);
            }

            GtkUtil.MakeMenuItem (popupMenu, Catalog.GetString ("Remove From Search"),
                          "gtk-remove",
                          new EventHandler (literal.HandleRemoveCommand),
                          true);

            if (isPopup) {
                if (eb != null)
                    popupMenu.Popup (null, null, null, eb.Button, eb.Time);
                else
                    popupMenu.Popup (null, null, null, 0, Gtk.Global.CurrentEventTime);
            }
        }
开发者ID:Yetangitu,项目名称:f-spot,代码行数:32,代码来源:LiteralPopup.cs

示例2: PopupMenu

		// Place the menu underneath an arbitrary parent widget.  The
		// parent widget must be set using menu.AttachToWidget before
		// calling this
		public static void PopupMenu (Gtk.Menu menu, Gdk.EventButton ev)
		{
			menu.Deactivated += DeactivateMenu;
			menu.Popup (null, 
				    null, 
				    new Gtk.MenuPositionFunc (GetMenuPosition), 
				    (ev == null) ? 0 : ev.Button, 
				    (ev == null) ? Gtk.Global.CurrentEventTime : ev.Time);
		}	
开发者ID:ArsenShnurkov,项目名称:beagle-1,代码行数:12,代码来源:BestTray.cs

示例3: Activate

		public void Activate (Gdk.EventButton eb, Literal literal, Gtk.Menu popup_menu, bool is_popup)
		{
			//this.literal = literal;

			/*MenuItem attach_item = new MenuItem (Catalog.GetString ("Find With"));
			TagMenu attach_menu = new TagMenu (attach_item, MainWindow.Toplevel.Database.Tags);
			attach_menu.TagSelected += literal.HandleAttachTagCommand;
			attach_item.ShowAll ();
			popup_menu.Append (attach_item);*/

			if (literal.IsNegated) {
				GtkUtil.MakeMenuItem (popup_menu,
						      Catalog.GetString ("Include"),
						      "gtk-cancel",
						      new EventHandler (literal.HandleToggleNegatedCommand),
						      true);
			} else {
				GtkUtil.MakeMenuItem (popup_menu,
						      Catalog.GetString ("Exclude"),
						      "gtk-delete",
						      new EventHandler (literal.HandleToggleNegatedCommand),
						      true);
			}

			GtkUtil.MakeMenuItem (popup_menu, Catalog.GetString ("Remove"),
					      "gtk-remove",
					      new EventHandler (literal.HandleRemoveCommand),
					      true);

			if (is_popup) {
				if (eb != null)
					popup_menu.Popup (null, null, null, eb.Button, eb.Time);
				else
					popup_menu.Popup (null, null, null, 0, Gtk.Global.CurrentEventTime);
			}
		}
开发者ID:AminBonyadUni,项目名称:facedetect-f-spot,代码行数:36,代码来源:TagQueryWidget.cs

示例4: ShowContextMenu

		public void ShowContextMenu (Gtk.Menu menu)
		{
			menu.Popup (null, null, null, 0, Gtk.Global.CurrentEventTime);
		}
开发者ID:Tak,项目名称:monodevelop-novell,代码行数:4,代码来源:CommandManager.cs

示例5: PopupContextMenuAtLocation

		void PopupContextMenuAtLocation (Gtk.Menu menu, int x, int y)
		{
			menu.ShowAll ();
			Gtk.MenuPositionFunc pos_menu_func = null;

			// Set up the funtion to position the context menu
			// if we were called by the keyboard Gdk.Key.Menu.
			if (x == 0 && y == 0)
				pos_menu_func = PositionContextMenu;

			try {
				menu.Popup (null, null,
					    pos_menu_func,
					    0,
					    Gtk.Global.CurrentEventTime);
			} catch {
				Logger.Debug ("Menu popup failed with custom MenuPositionFunc; trying again without");
				menu.Popup (null, null,
					    null,
					    0,
					    Gtk.Global.CurrentEventTime);
			}
		}
开发者ID:MichaelAquilina,项目名称:tomboy,代码行数:23,代码来源:RecentChanges.cs


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