GNOME Bugzilla – Bug 154068
Access to human readable string from Gtk::AccelKey would be nice
Last modified: 2004-12-22 21:47:04 UTC
AccelKey.get_abbrev() seems to output "<Control>n" rather than "Ctrl+N". It would be useful to have access to the latter representation.
I guess that menu items have some way to do this, because they do show the human-readable keyboard combination - could you investigate this, please?
Created attachment 32194 [details] [review] a quick patch Here is a patch which factors the requested functionality out from gtkaccellabel and adds gtk_accelerator_display_name().
The patch as is breaks the really obscure feature of overriding the mod_name_alt, etc strings in classes derived from GtkAccelLabel. Waiting for timj's comment on that, since it is his code.
2004-10-05 Matthias Clasen <mclasen@redhat.com> Provide access to the string representation of accelerators used in GtkAccelLabel. (#154068, John Spray) * gtk/gtkaccelgroup.h: * gtk/gtkaccelgroup.c (gtk_accelerator_get_label): New function to return the accelerator label used in GtkAccelLabel. (gtk_accelerator_name): Update docs to point to gtk_accelerator_get_label(). * gtk/gtkaccellabel.h: * gtk/gtkaccellabel.c (_gtk_accel_label_class_get_accelerator_label): New auxiliary function which creates the string representing the accelerator.