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 764000 - Can't change submenu item label at runtime
Can't change submenu item label at runtime
Status: RESOLVED DUPLICATE of bug 667779
Product: gtk+
Classification: Platform
Component: Class: GtkApplication
3.20.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks: 417141
 
 
Reported: 2016-03-21 16:33 UTC by Bastien Nocera
Modified: 2016-03-21 21:26 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Bastien Nocera 2016-03-21 16:33:50 UTC
After creating a submenu:
        label = get_submenu_label_for_index (NORMAL_RATE_IDX);
        priv->submenu_item = g_menu_item_new_submenu (label, G_MENU_MODEL (submenu));
        g_free (label);
        g_menu_insert_item (menu, -1, priv->submenu_item);

Calling:
        g_menu_item_set_label (G_MENU_ITEM (priv->submenu_item), label);
doesn't do anything

Calling:
        menu = totem_object_get_menu_section (priv->totem, "variable-rate-placeholder");
        g_menu_remove (menu, 0);
        g_menu_item_set_label (G_MENU_ITEM (priv->submenu_item), label);
        g_menu_insert_item (menu, -1, priv->submenu_item);
doesn't update the label of the submenu heading, and throws warnings like:
(totem:2431): Gtk-WARNING **: Duplicate child name in GtkStack: Speed: 1.5
Totem-Message: new label: Speed: 1.5
(totem:2431): GLib-GIO-CRITICAL **: g_menu_item_get_attribute: assertion 'G_IS_MENU_ITEM (menu_item)' failed
As also seen in bug 749405.

The goal is to create a menu that looks like:
https://github.com/gnome-design-team/gnome-mockups/blob/aa99f912123fdf079d1aeaa9243935bb7fc3f9fa/videos/wireframes/png/playback-speed.png
though I accept that the submenu item label should be the same as the submenu heading label (the second part of the mockup would say "Speed: Normal" instead of "Speed").
Comment 1 Allison Karlitskaya (desrt) 2016-03-21 21:26:15 UTC

*** This bug has been marked as a duplicate of bug 667779 ***