
Receiving click events with GLWidget
Posted Monday, 22 September, 2008 - 21:54 by jcornwall inThis isn't strictly an OpenTK question as it is based on jtalton's GLWidget, which I need for portability, rather than GLControl.
I'm using GLWidget successfully on Linux and Windows in my application. I want to receive mouse button press events but neither of these approaches invoke the event handler when I click the widget:
protected override bool OnButtonPressEvent(Gdk.EventButton e) { Console.WriteLine("Button pressed"); return true; }
this.ButtonPressEvent += new ButtonPressEventHandler(HandleButtonPress); ... [GLib.ConnectBefore] protected void HandleButtonPress(object sender, ButtonPressEventArgs args) { Console.WriteLine("Button pressed"); }
GLWidget is a Gtk.DrawingArea so it should receive button presses. Am I missing something?


Comments
Re: Receiving click events with GLWidget
Always the way, make a post and then the solution reveals itself. :)
this.AddEvents((int)EventMask.ButtonPressMask);