Re: Shortcuts to buttons



HRahman10 aol com writes:
> Hi, thanks for that, but how do create a GtkAccelGroup, how do you use it,
> what it is it? There dosn't seem to be any documentation on it.

Something like this (omitting some details, such as casts):

 label = gtk_label_new (NULL);
 accel_key = gtk_label_parse_uline (label, "_Foo");
 button = gtk_button_new ();
 gtk_container_add (button, label);
 
 group = gtk_accel_group_new ();

 gtk_accel_group_add (group, accel_key, GDK_MOD1_MASK, 
                      GTK_ACCEL_LOCKED,
                      button, "clicked");

 gtk_window_add_accel_group (window, group);
 gtk_accel_group_unref (group);

Havoc





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