After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 154068 - Access to human readable string from Gtk::AccelKey would be nice
Access to human readable string from Gtk::AccelKey would be nice
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2004-09-29 15:30 UTC by John Spray
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
a quick patch (7.56 KB, patch)
2004-10-04 05:52 UTC, Matthias Clasen
none Details | Review

Description John Spray 2004-09-29 15:30:21 UTC
AccelKey.get_abbrev() seems to output "<Control>n" rather than "Ctrl+N".

It would be useful to have access to the latter representation.
Comment 1 Murray Cumming 2004-09-30 07:19:00 UTC
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?
Comment 2 Matthias Clasen 2004-10-04 05:52:50 UTC
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().
Comment 3 Matthias Clasen 2004-10-05 03:45:49 UTC
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. 
Comment 4 Matthias Clasen 2004-10-05 05:18:31 UTC
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.