RE: connecting a callback to a "key_press_event" signal on a button



Actually, looking at the recently ported app further, I noticed that no
keyboard navigation keys are
working under GTK+2.0 now.  Again, it worked fine in 1.2, but since
compiling with 2.0, space so longer
selects rows in a clist, I can't use the arrow keys or tab to move focus
around.
I have my own functions that call gtk_widget_child_focus( Toplevel_window,
GTK_DIR_UP), etc,
and that does cause the focus to move around.  So i don't think it has
anything to do with
the child's ability to focus.  It's just like the CList (or my buttons, when
they have focus) aren't
seeing the key_press_event at all.  I'm stumped.

-----Original Message-----
From: gtk-app-devel-list-admin gnome org
[mailto:gtk-app-devel-list-admin gnome org]On Behalf Of Erik Simonsen
Sent: Wednesday, August 28, 2002 2:03 PM
To: gtk-app-devel-list gnome org
Subject: connecting a callback to a "key_press_event" signal on a button


I have an keyboard-driven app that I am porting from GTK+ 1.2 to 2.0.

I use the following code to create a button (I do this repeatedly to create
an array of buttons and pack them into a table) and call a callback every
time the user presses a keyboard key while a gtk_button has focus.

        buttons[cnt] = gtk_button_new_with_label(lbl);
        gtk_widget_ref(buttons[cnt]);
        gtk_object_set_data_full (GTK_OBJECT (playa), title, buttons[cnt],
                                (GtkDestroyNotify) gtk_widget_unref);
        gtk_widget_show(buttons[cnt]);
        gtk_signal_connect (GTK_OBJECT(buttons[cnt]), "key_press_event",
                        GTK_SIGNAL_FUNC (on_button_pressed), NULL);



Everything worked fine on 1.2.  On 2.0 however, the callback is never
getting called.

Any ideas?

Thanks

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list




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