Key binding for GtkButton howto
- From: Mikael Hermansson <mikeh algonet se>
- To: "gtk-list redhat com" <gtk-list redhat com>
- Subject: Key binding for GtkButton howto
- Date: Wed, 09 Sep 1998 19:09:12 +0000
How to bind a keyevent to a button:
Example I want to close the window if user clicks on button or pressing
<CONTROL> + "x"
I have tryed the above but it will not work, whats wrong?
....
GtkAccelGroup *grp=gtk_accel_group_new();
buttondone=gtk_button_new_with_label("Done");
editlangA=gtk_entry_new();
....
gtk_widget_add_accelerator(buttondone,"clicked",grp,GDK_CONTROL_L,"x",
GTK_ACCEL_VISIBLE | GTK_ACCEL_SIGNAL_VISIBLE);
gtk_signal_connect(GTK_OBJECT(buttondone),"clicked",
GTK_SIGNAL_FUNC(GlosButtons),this);
--
http://www.algonet.se/~mikeh
E-mail: mikeh@algonet.se
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]