Accelerators in 1.1

I am using the 1.1 series of GTK and am trying to figure out how to get
accelerator keys to work.  I am writing a program that must respond to
Ctrl-C, but I don't have to have a menu.  Is there any way that I can do
this without a menu??  If I have to add a menu, I suppose this would be
fine.  I have not been able to find any sample code for the 1.1 series
using the new GtkAccelGroup and associated commands.  If there is any
sample code that I could find on the web, please let me know about it.

My attempt has been as follows:

void ctrlc(GtkWidget *a, gpointer data)

GtkAccelGroup *accel = gtk_accel_group_new();
gtk_accel_group_add(accel, 'C', 4, GTK_ACCEL_GROUP_MASK,
	GTK_OBJECT(window), "signal");
gtk_signal_connect(GTK_OBJECT(window), "signal", ctrlc, NULL);
gtk_accel_group_attach(accel, GTK_OBJECT(window));

However, I do not know what signal to pass, so I get an error that states
that it cannot find the signal in the window object hierarchy or that the
various signals are not valid to be used as accelerator signals.  Does
anyone know of the correct signal to use here.  When I use "destroy", it
works but gives a few errors on exit.  Thus, I think that if I get the
correct signal then I will have it.  Is there a list of the signals
available to use regarding the window object??

Thank you very much for any help that you can provide.
Mike Lindahl

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