本文整理汇总了C#中Gtk.Menu.Attach方法的典型用法代码示例。如果您正苦于以下问题:C# Menu.Attach方法的具体用法?C# Menu.Attach怎么用?C# Menu.Attach使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.Menu
的用法示例。
在下文中一共展示了Menu.Attach方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: on_treeview_load_button_release_event
private void on_treeview_load_button_release_event(object o, ButtonReleaseEventArgs args)
{
Gdk.EventButton e = args.Event;
if (e.Button == 3) {
Menu myMenu = new Menu ();
Gtk.MenuItem myItem;
myItem = new MenuItem (Catalog.GetString("Delete selected"));
myItem.Activated += on_delete_selected_row_clicked;
myMenu.Attach( myItem, 0, 1, 0, 1 );
myMenu.Popup();
myMenu.ShowAll();
}
}
示例2: treeviewRunsIntervalContextMenu
private void treeviewRunsIntervalContextMenu(RunInterval myRun)
{
Menu myMenu = new Menu ();
Gtk.MenuItem myItem;
/*
myItem = new MenuItem ( Catalog.GetString("Play Video") + " " +
myRun.Type + " (" + myRun.PersonName + ")");
if(File.Exists(Util.GetVideoFileName(currentSession.UniqueID,
Constants.TestTypes.RUN_I, myTreeViewRunsInterval.EventSelectedID))) {
myItem.Activated += on_video_play_selected_run_interval_clicked;
myItem.Sensitive = true;
} else
myItem.Sensitive = false;
myMenu.Attach( myItem, 0, 1, 0, 1 );
*/
myItem = new MenuItem ( Catalog.GetString("Edit selected") + " " + myRun.Type + " (" + myRun.PersonName + ")");
myItem.Activated += on_edit_selected_run_interval_clicked;
myMenu.Attach( myItem, 0, 1, 0, 1 );
myItem = new MenuItem ( Catalog.GetString("Repair selected") + " " + myRun.Type + " (" + myRun.PersonName + ")");
myItem.Activated += on_repair_selected_run_interval_clicked;
myMenu.Attach( myItem, 0, 1, 1, 2 );
Gtk.SeparatorMenuItem mySep = new SeparatorMenuItem();
myMenu.Attach( mySep, 0, 1, 2, 3 );
myItem = new MenuItem ( Catalog.GetString("Delete selected") + " " + myRun.Type + " (" + myRun.PersonName + ")");
myItem.Activated += on_delete_selected_run_interval_clicked;
myMenu.Attach( myItem, 0, 1, 3, 4 );
myMenu.Popup();
myMenu.ShowAll();
}
示例3: treeviewPersonsContextMenu
private void treeviewPersonsContextMenu(Person myPerson)
{
Menu myMenu = new Menu ();
Gtk.MenuItem myItem;
myItem = new MenuItem ( Catalog.GetString("Edit") + " " + myPerson.Name);
myItem.Activated += on_edit_current_person_clicked;
myMenu.Attach( myItem, 0, 1, 0, 1 );
myItem = new MenuItem ( Catalog.GetString("Show all tests of") + " " + myPerson.Name);
myItem.Activated += on_show_all_person_events_activate;
myMenu.Attach( myItem, 0, 1, 1, 2 );
Gtk.SeparatorMenuItem mySep = new SeparatorMenuItem();
myMenu.Attach( mySep, 0, 1, 2, 3 );
myItem = new MenuItem ( string.Format(Catalog.GetString("Delete {0} from this session"),myPerson.Name));
myItem.Activated += on_delete_current_person_from_session_clicked;
myMenu.Attach( myItem, 0, 1, 3, 4 );
myMenu.Popup();
myMenu.ShowAll();
}
示例4: treeviewMultiChronopicContextMenu
private void treeviewMultiChronopicContextMenu(MultiChronopic mc)
{
Menu myMenu = new Menu ();
Gtk.MenuItem myItem;
/*
myItem = new MenuItem ( Catalog.GetString("Play Video") + " " +
mc.Type + " (" + mc.PersonName + ")");
if(File.Exists(Util.GetVideoFileName(currentSession.UniqueID,
Constants.TestTypes.MULTICHRONOPIC, myTreeViewMultiChronopic.EventSelectedID))) {
myItem.Activated += on_video_play_selected_multi_chronopic_clicked;
myItem.Sensitive = true;
} else
myItem.Sensitive = false;
myMenu.Attach( myItem, 0, 1, 0, 1 );
*/
myItem = new MenuItem ( Catalog.GetString("Edit selected") + " " + mc.Type + " (" + mc.PersonName + ")");
myItem.Activated += on_edit_selected_multi_chronopic_clicked;
myMenu.Attach( myItem, 0, 1, 0, 1 );
/*
myItem = new MenuItem ( Catalog.GetString("Repair selected") + " " + mc.Type + " (" + mc.PersonName + ")");
myItem.Activated += on_repair_selected_multi_chronopic_clicked;
myMenu.Attach( myItem, 0, 1, 2, 3 );
*/
Gtk.SeparatorMenuItem mySep = new SeparatorMenuItem();
myMenu.Attach( mySep, 0, 1, 1, 2 );
myItem = new MenuItem ( Catalog.GetString("Delete selected") + " " + mc.Type + " (" + mc.PersonName + ")");
myItem.Activated += on_delete_selected_multi_chronopic_clicked;
myMenu.Attach( myItem, 0, 1, 2, 3 );
myMenu.Popup();
myMenu.ShowAll();
}
示例5: treeviewJumpsContextMenu
private void treeviewJumpsContextMenu(Jump myJump)
{
Menu myMenu = new Menu ();
Gtk.MenuItem myItem;
/*
myItem = new MenuItem ( Catalog.GetString("Play Video") + " " +
myJump.Type + " (" + myJump.PersonName + ")");
if(File.Exists(Util.GetVideoFileName(currentSession.UniqueID,
Constants.TestTypes.JUMP, myTreeViewJumps.EventSelectedID))) {
myItem.Activated += on_video_play_selected_jump_clicked;
myItem.Sensitive = true;
} else
myItem.Sensitive = false;
myMenu.Attach( myItem, 0, 1, 0, 1 );
*/
myItem = new MenuItem ( Catalog.GetString("Edit selected") + " " + myJump.Type + " (" + myJump.PersonName + ")");
myItem.Activated += on_edit_selected_jump_clicked;
myMenu.Attach( myItem, 0, 1, 0, 1 );
Gtk.SeparatorMenuItem mySep = new SeparatorMenuItem();
myMenu.Attach( mySep, 0, 1, 1, 2 );
myItem = new MenuItem ( Catalog.GetString("Delete selected") + " " + myJump.Type + " (" + myJump.PersonName + ")");
myItem.Activated += on_delete_selected_jump_clicked;
myMenu.Attach( myItem, 0, 1, 2, 3 );
myMenu.Popup();
myMenu.ShowAll();
}
示例6: treeviewContextMenu
private void treeviewContextMenu()
{
menuCtx = new Menu ();
Gtk.MenuItem myItem;
if(genericWinContextMenu == Constants.ContextMenu.EDITDELETE) {
myItem = new MenuItem ( Catalog.GetString("Edit selected") );
myItem.Activated += on_edit_selected_clicked;
menuCtx.Attach( myItem, 0, 1, 0, 1 );
myItem = new MenuItem ( Catalog.GetString("Delete selected") );
myItem.Activated += on_delete_selected_clicked;
menuCtx.Attach( myItem, 0, 1, 1, 2 );
}
else if(genericWinContextMenu == Constants.ContextMenu.DELETE) {
myItem = new MenuItem ( Catalog.GetString("Delete selected") );
myItem.Activated += on_delete_selected_clicked;
menuCtx.Attach( myItem, 0, 1, 0, 1 );
} else {
//don't show nothing if there are no options
menuCtx.Popdown();
return;
}
menuCtx.Popup();
menuCtx.ShowAll();
}