Re: how to prevent Gtk::Entry to "Pass on" key event?



2012-06-21 12:19, jody skrev:
Hi Robert

Thanks for the tip.
I tried this and it works!

But in the documentation for Gtk::Entry::signal_activate it says:
   Deprecated:
     Use signal_key_press_event() or signal_focus_out_event() instead.
In this special case, you can ignore the deprecation (provided you do not define GTKMM_DISABLE_DEPRECATED during compilation). Gtk::Entry::signal_activate() is deprecated in gtkmm 3.4, because the gtk+ documentation said that application programs should not use it. That has been changed. Gtk::Entry::signal_activate() will not be deprecated in gtkmm 3.6. It's true that you can use signal_key_press_event() instead, but it's slightly more complicated, if you just want to detect a pressed Enter key.
Apparently the developers seem to think i can get the same effect with
signal_key_press_event(),
so i looked again at what Kjell originally suggested.

Finally i found that:when connecting the Entry to this signal, you
have to use after=false
(in order to get all the keys the Entry swallows).


Thanks to all of you helping me to find a way through the Event mysteries :)

Jody

On Wed, Jun 20, 2012 at 7:31 PM, Robert Pearce<rob bdt-home demon co uk>  wrote:
Hi jody,

On Wed, 20 Jun 2012 15:33:10 +0200 you wrote:
So if there is no way to get a Gdk_Return from a Entry,
i guess i'll have to to do some ugliness (catch all key events first,
and if my entry has the focus, ill call the appropriate function;
otherwise (no focus) i check for 'f' etc.etc)
Could you perhaps avoid needing to get the GDK_Return? The Gtk::Entry
presumably handles the return key in a way that causes it to emit a
signal (signal_activate?). Could you not look for that instead?




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