public ITreeItem GetNodeAt(PointF point) { Gtk.TreePath path; if (tree.GetPathAtPos((int)point.X, (int)point.Y, out path)) { return model.GetItemAtPath(path); } return null; }
protected void OnRight(object sender, Gtk.ButtonPressEventArgs e) { if (e.Event.Button == 3) // Botón derecho. { Gtk.TreePath RowPath; if (Exercises.GetPathAtPos(Convert.ToInt32(e.Event.X), Convert.ToInt32(e.Event.Y), out RowPath)) { int ActiveRow = RowPath.Indices[0]; Gtk.Menu m = new Gtk.Menu(); Gtk.MenuItem DeleteExercise = new Gtk.MenuItem("Delete exercise"); DeleteExercise.ButtonPressEvent += (o, a) => OnDelete(ActiveRow); m.Add(DeleteExercise); m.ShowAll(); m.Popup(); } } }