"Ctrl+c" text in menu item gets lost



In gtkmm-documentation-master/examples/book/application/app_and_win_menus/exampleapplication.cc is this:

Glib::RefPtr<Gio::MenuItem> item = Gio::MenuItem::create("_Copy", "win.copy"); //Setting "accel" works, but might be deprecated soon: See https://bugzilla.gnome.org/show_bug.cgi?id=708908 //When it is deprecated, use Gtk::Application::set_accel_for_action() instead. item->set_attribute_value("accel", Glib::Variant<Glib::ustring>::create("<Primary>c"));
  submenu_edit->append_item(item);

This code displays "Ctrl+c" in the menu item and the accelerator works as expected. However, when the suggested change is made:

Glib::RefPtr<Gio::MenuItem> item = Gio::MenuItem::create("_Copy", "win.copy");
  set_accel_for_action("win.copy", "<Primary>c");
  submenu_edit->append_item(item);

the accelerator still works but the key combination hint is no longer shown in the menu.

Is there something else that needs to be done to restore the "Ctrl+c" part of the menu display?

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