[gtkada] Q re keypresses in a notebook.

Bobby D. Bryant bdbryant at mail.utexas.edu
Tue Mar 21 13:00:42 CET 2000


Part of a UI that I am working on is a notebook where the first page is
a set of control widgets and the remaining pages are nothing but
pixmaps.  When a pixmap is on top I want to be able to manipulate it
with keypresses.

If I simply set up a keypress callback for each page, nothing happens
when I press a key (unless it is an arrow key, CR, or TAB, in which case
there is navigation among the page tabs.) [As an aside, I should say
that the widgets in the control page work normally -- the only thing I
have trouble trapping is the keypresses.]

If however I set up the keypress callback for the main window rather
than for a page, I do trigger it for every keystroke (though oddly
enough the arrow keys still navigate the page tabs *in*addition* to
triggering the callback).

So it looks like I need to set up a semi-complicated scheme where I only
have one keypress callback defined for the whole application, defined
for the window rather than for the pixmaps, and each time it is
triggered it needs to check to see which page is currently active and
dispatch that page's handle to the appropriate action routine.

I am pretty sure I can make this work, but the scheme seems quite
baroque compared to the straightforwardness of everything else I do with
GTK/GtkAda, so I cannot help but wonder if there is some more direct way
to do this, which I have not stumbled upon?

Any tips will be appreciated,

Bobby Bryant
Austin, Texas

p.s. - The above is slightly simplified for clarity. In case it happens
to matter, I actually have *two* notebooks, a main notebook and a
secondary notebook that appears as a page in the main one. The pixmaps
and associated control page are in the secondary notebook. Also, the
"pixmaps" are actually widgets derived from a pixmap, each having a
record of auxiliary data and some procedures/functions to operate on it.








More information about the gtkada mailing list