本文整理汇总了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);
}
}
示例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);
}
示例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);
}
}
示例4: ShowContextMenu
public void ShowContextMenu (Gtk.Menu menu)
{
menu.Popup (null, null, null, 0, Gtk.Global.CurrentEventTime);
}
示例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);
}
}