GnomeCanvas and keyboard focus



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

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).

I do override the event class vfunc for some of the canvas items which
is called when I click in the window.  Do I need to "chain up" to the
default event handler of GnomeCanvasItem to make things work (AFAICT,
Gnumeric items don't)?  Since the canvas events are "synthetic", I
didn't think they would affect GtkWidget events.

What I really want to achieve is to trap the cursor keys, TAB, ENTER
and SHIFT keys either in a canvas item, the canvas widget or the
parent table widget.  Where isn't important (they all reference the
underlying CseSelection object that represents the cell selection),
but I do need to be able to focus the canvas.

(To see the behaviour, the source is here (program cse/cse, file
cse/cse-canvas.[ch]:
http://www.whinlatter.ukfsn.org/gtk/uterm-0.1.0.tar.bz2)


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/>

iD8DBQFCF8BrVcFcaSW/uEgRAhrIAKCSXgKGQcbUsTCyep2Q/leMrI7pmACeJkQd
moEfliovb6gxpJORKPiSrHE=
=PmDa
-----END PGP SIGNATURE-----



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