[gtkada] Input focus issue (was: Accelerators and popup windows)

Stefan Bellon sbellon at sbellon.de
Sat Apr 9 07:52:14 CEST 2005


On 01 Apr, I wrote:
> Emmanuel Briot wrote:
> > Stefan Bellon wrote:
> > > Is there any Gtk way I'm overlooking how to handle accelerators
> > > in popup menus of different windows of the same type? To take
> > > Gimp a non-Ada example: If you press '+', exactly the window with
> > > the input focus gets zoomed in.

> > I would connect to the focus_in_event and focus_out_event for all
> > the toplevel windows that you open, and keep track of the currently
> > active one this way. If you are using GtkAda.MDI, you can also
> > easily get that information.

> Yes, that's basically what I've done in the meantime. Thanks for the
> reply.

I have got the accelerator stuff working nicely now. However, the user
can assign a single character shortcut (like just 'a' or '+') to a menu
item. Now, if there's a Gentry widget in the window, once you put the
input focus inside that widget, you can enter text there and the single
character shortcuts obviously don't work anymore.

How do I take away the input focus of the Gentry widget? When pressing
return inside the Gentry widget or clicking inside the window itself I
could then take the input focus out of the Gentry widget so that the
accelerators work again.

-- 
Stefan Bellon



More information about the gtkada mailing list