Re: GnomeCanvas and keyboard focus



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Roger Leigh <rleigh whinlatter ukfsn org> writes:

This might sound a little vague, but I'm having problems with my
canvas widget grabbing keyboard focus.  The canvas is packed into a
derived GtkTable which is packed into a GtkNotebook.  If I click on
the notebook tab label, it gets a focus dashed-line, but if I then
click on the canvas this does not disappear.

To try to debug this I've set GTK_CAN_FOCUS, and connected a handler
(returning FALSE) to "grab-focus" which just g_print's a message, but
this is only triggered when I use the cursor up key to enter the table
from the bottom.  It's not called if I enter from the top or click in
the window (the canvas is in the bottom RHS of the table).

After a little more testing:

- - focus-in-event and focus-out-event are emitted from the canvas when
  I focus in or out with the cursor keys, but focus-in-event is not
  emitted when I click on the canvas.
- - key-press-event is emitted when the canvas is focussed.
- - I disabled all GnomeCanvasItemClass->event handlers in my custom
  canvas items, but to no effect.

So something is preventing focussing with the mouse.  Could anyone
suggest what might be the cause, or how to find out what the cause
might be?


Many thanks,
Roger

- -- 
Roger Leigh
                Printing on GNU/Linux?  http://gimp-print.sourceforge.net/
                Debian GNU/Linux        http://www.debian.org/
                GPG Public Key: 0x25BFB848.  Please sign and encrypt your mail.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8 <http://mailcrypt.sourceforge.net/>

iD8DBQFCGPZqVcFcaSW/uEgRAqTCAJ9eiICvZfsXrulqLr8gN2GAb1FI3wCg2cVL
A1NvMUcVpTOOFPA+LDYdvlE=
=+Guh
-----END PGP SIGNATURE-----



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]