本文整理汇总了C#中Gtk.Menu.Show方法的典型用法代码示例。如果您正苦于以下问题:C# Menu.Show方法的具体用法?C# Menu.Show怎么用?C# Menu.Show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.Menu
的用法示例。
在下文中一共展示了Menu.Show方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuildContextMenu
private void BuildContextMenu()
{
if (menu != null) {
return;
}
menu = (Menu)interface_action_service.UIManager.GetWidget("/NotificationAreaIconMenu");
menu.Show ();
for (int i = 0; i < menu.Children.Length; i++) {
if (menu.Children[i].Name == "Previous") {
int j = i;
PlaybackRepeatActions repeat_group = interface_action_service.FindActionGroup ("PlaybackRepeat")
as PlaybackRepeatActions;
if (repeat_group != null) {
menu.Insert (repeat_group.CreateSubmenu (), i++ + 2);
}
PlaybackShuffleActions shuffle_group = interface_action_service.FindActionGroup ("PlaybackShuffle")
as PlaybackShuffleActions;
if (shuffle_group != null) {
menu.Insert (shuffle_group.CreateSubmenu (), i++ + 2);
}
if (j != i) {
menu.Insert (new SeparatorMenuItem (), i++ + 2);
}
rating_menu_item = new RatingMenuItem ();
rating_menu_item.Activated += OnRatingChanged;
ToggleRatingMenuSensitive ();
menu.Insert (rating_menu_item, i + 2);
break;
}
}
}
示例2: ShowMainMenu
private static void ShowMainMenu(IMenuItemParams[] items)
{
var popupMenu = new Menu();
var subitems = GetList(items, null);
foreach (var subitem in subitems)
{
popupMenu.Add(subitem);
}
popupMenu.Show();
popupMenu.Popup();
}