开发者

Getting the mouse coordinates when ButtonPressEvent occurs

开发者 https://www.devze.com 2023-01-01 07:31 出处:网络
I\'ve wrapped a drawin开发者_Go百科g area in an event box so that I can catch mouse clicks with this function:

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消