Re: [gtk-list] how to active key_release_event signal in GtkEntry



Thursday Sep 9 11:22:57 -0600 1999 Jiang XU <jiang.xu@echostar.com> wrote:
> I try to add a signal callback function of a GtkEntry.  The signal is
> "key_release_event"
> I use the gtk_signal_connect(..,"key_release_event",..)
> But it doesn't work, I wonder why?

First you need to write:

gtk_widget_add_events(widget, GDK_KEY_PRESS_MASK|GDK_KEY_RELEASE_MASK);

To make it possible to receive such events (may work without, never tested
without). 

Then:

GTK_WIDGET_SET_FLAGS(widget, GTK_CAN_FOCUS);

Then, pressing <TAB> will eventually give you widget a focus so
it can receive button events.

If you want initially have focus on your widget, add:

gtk_widget_grab_focus(widget);



Tomi



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