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 708908 - GMenuItem: There is no G_MENU_ATTRIBUTE_ACCEL
GMenuItem: There is no G_MENU_ATTRIBUTE_ACCEL
Status: RESOLVED WONTFIX
Product: glib
Classification: Platform
Component: gio
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2013-09-27 10:37 UTC by Murray Cumming
Modified: 2014-04-01 11:06 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Murray Cumming 2013-09-27 10:37:35 UTC
I can specify an accelerator for a GMenuItem by doing:
  g_menu_item_set_attribute (menuitem, "accel", "<Primary>v");

Surely there should be a #define for this "standard attribute name", like the existing ones:
https://developer.gnome.org/gio/unstable/GMenuModel.html#G-MENU-ATTRIBUTE-LABEL:CAPS
Comment 1 Allison Karlitskaya (desrt) 2013-10-01 08:46:22 UTC
The eventual goal is to move away from directly specifying accels in menus, so I'd rather not add this now...

Essentially, hardcoding an accel into a menuitem will prevent runtime dynamic changing of accels, which is a feature (as it turns out) that many people still want.

See this branch (hopefully landing soon) for more info about how this will work: 
https://git.gnome.org/browse/gtk+/log/?h=wip/action-descriptions
Comment 2 Murray Cumming 2013-10-01 09:04:24 UTC
OK, thanks, so then we would always call something like
  gtk_application_add_accelerator (GTK_APPLICATION (application), "<Primary>l", "win.justify", g_variant_new_string ("left"));
in code for every accelerator as in that branch's bloatpad.c?

It would still be nice to specify the initial default accelerator in the XML.
Comment 3 Allison Karlitskaya (desrt) 2013-10-01 09:28:08 UTC
There is going to be a new XML format for "action descriptions".  The default accels will be there.  This work will land this cycle.
Comment 4 Murray Cumming 2014-04-01 11:06:45 UTC
(In reply to comment #3)
> There is going to be a new XML format for "action descriptions".  The default
> accels will be there.  This work will land this cycle.

Did that happen?