Re: catching messages

On Tue, 2006-01-10 at 11:15 +0100, Diego Zuccato wrote:
> Martyn Russell wrote:
> > What key press?
> > You want to use the GtkWidget signal "key-press-event" and look at the
> > GdkEventKey that comes back with that. The keyval should be one of the
> > values in gtk/gdk/gdkkeysyms.h (for example GDK_Escape).
> Exactly ESC.
> What I did is (since gtk_signal_connect is deprecated):
> g_signal_connect(G_OBJECT(combo), "key_press_event",
> G_CALLBACK(reset_combo), GINT_TO_POINTER(presel));
> But reset_combo NEVER gets called :(
> Any hint?

Did you attach the "key-press-event" signal to the GtkComboBox? and did
the GtkComboBox have focus when you pressed Esc?

If you want Esc to work across the whole window you will have to attach
the signal to the window widget.  Also, you don't need to use
G_OBJECT(combo) since the combo is a GObject, you can just use "combo".


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