[gtkada] Re: Using modifier+return in Gtk_Entry

Stefan Bellon sbellon at sbellon.de
Fri Oct 15 16:43:42 CEST 2004


Stefan Bellon wrote:

> I'm successfully using the Gtk_Entry widget in order to have the user
> enter some text and when he presses return, the "activate" signal
> calls the handler I registered and everything is fine.
>
> However, I'd like to execute different actions for return,
> shift+return, alt+return, ctrl+return and even the combinations
> thereof.
>
> The "activate" signal however is only emitted if just return is
> pressed without any modifiers. How do I solve my problem?

Ok, I got a bit further by myself:

I added accelerators to the Gtk_Entry widget for all combinations of
Shift, Alt and Control together with return. I use all those
accelerators to send the "activate" signal. This is working just fine
and the handler is called for modifier+return now as well as for return
only.

But how do I get at the pressed modifier from within the activate
handler? My handler gets passed the Gtk_Entry and user data at present.
Adding an event to the handler signature and doing a Get_State(Event)
in the handler does not work: Although the Marshaller does not
complain, it crashes with a STORAGE_ERROR when the handler is called.

What am I missing or overlooking?

-- 
Stefan Bellon



More information about the gtkada mailing list