connecting a callback to a "key_press_event" signal on a button
- From: "Erik Simonsen" <erik pinksheets com>
- To: <gtk-app-devel-list gnome org>
- Subject: connecting a callback to a "key_press_event" signal on a button
- Date: Wed, 28 Aug 2002 14:02:53 -0400
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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]