Hello,
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.

paolino


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
here:

https://gitorious.org/ruff/gruff/source/98ffd41ff2d66c529f96697768bcd2559cd60b7a:src/GLUTGtk.hs

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

https://github.com/ivanperez-keera/gloss-gtk/blob/master/Graphics/UI/GLUTGtk.hs

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
gloss-gtk


Claude
--
http://mathr.co.uk


------------------------------------------------------------------------------
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!
http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
_______________________________________________
Gtk2hs-users mailing list
Gtk2hs-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gtk2hs-users