the canFocus works, while I failed to cath keyboard press events with the eventBox.
I didn't know there was a special filter for some events. Maybe it's a feature. It looks like a bad design choice.
I've spent some hours trying to work around that, catching keyboard in the main window and checking pointer position via enter and leave notification. Now it's clean again.

Thanks a lot.


2013/9/8 Claude Heiland-Allen <claude@mathr.co.uk>
Hi Paolino,

On 08/09/13 16:30, Paolino wrote:
> Is this a feature of the wrapped library or something to do with the
> wrapper ?

I think it's a feature of gtkglext, or gtk itself, but I'm not sure.

> Is there a solution ?

I think there are a couple:

1. put it in an eventBox, and handle events for that widget, which I did


2. set canFocus and enable the events you want on the canvas itself,
which is done here (though the readme says "untested"):


If the second technique works, it'd probably be less error prone (for
example an eventBox with interior borders might mess up coordinates,
though I haven't tested whether that occurs).

Ivan: I see a fixme comment in your code, perhaps it was adapted from
something I wrote? - if so, feel free to use it under the MIT license of


Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
Gtk2hs-users mailing list