I've wrapped a drawin开发者_Go百科g area in an event box so that I can catch mouse clicks with this function:
protected virtual void OnEventbox1ButtonPressEvent (object o, Gtk.ButtonPressEventArgs args)
{
Console.WriteLine("Clicked!");
}
How can I find out where the mouse clicked?
Usually that information is stored in the args
object. I'm not terribly familiar with Gtk, but I imagine it's not too dissimilar to the .Net click event implementation.
精彩评论