Re: Erro with "key-press-event" signal



On Mon, May 31, 2010 at 09:47:26AM -0300, frederico schardong wrote:
> I have a window with a callback to resolve the "key-press-event"
> signal. The callback is:
> 
> gboolean alterCurrentTab(GtkWidget widget, GdkEventKey *event,
> gpointer user_data)
> {
>     g_print("\nkey: %s - %d - %lu", gdk_keyval_name(event->keyval),
> event->state, event->hardware_keycode);
>     return FALSE;
> }
> 
> The problem is that the return is always:
> key: (null) - -15694833 - 51081
> 
> Obs: I'm using the gtk_widget_set_events(window, GDK_KEY_PRESS_MASK);
> on this window.
> 
> What I'm doing wrong?

If you really declare the first argument as GtkWidget widget instead of
GtkWidget *widget then you get complete rubbish in the function
arguments.

Yeti



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