Re: combo box



> my_func is signal handler for both - key press and key_release
>events, but only key_press is active all the time

I noted on the list a week or so ago that a number of widgets only
receive key_press by default. you need to use gtk_widget_add_events()
if you want key_release as well.

>release never appears and after press <Up> focus goes out (it goes out
>right afrer key_press, before release <Up> button !)

yep, thats the way the built-in focus handlers work.

>if i remove
>gtk_signal_emit_stop_by_name (GTK_OBJECT (widget), "key_release_event")
>- no more Gtk-Warnings, but focus goes out of combo's entry area.

did you conditionalize the stop_by_name() on the type of event? you
should have:

       gint my_callback (GtKWidget *w, GdkEventKey *event, gpointer data)
       {
            ...
	    switch (event->type) {
	    case GDK_KEY_PRESS:
	         gtk_signal_emit_stop_by_name (w, "key_press_event");
		 break;
	    case GDK_KEY_RELEASE:
	         gtk_signal_emit_stop_by_name (w, "key_release_event");
		 break;
            default:
		 break;
            }
	    return TRUE;
      }

--p




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