Gtk-WARNING While adding page: duplicate child name in GtkStack

I found strange GTK warning on application launch, after build menu model that uses non-unique Label names for items (in different hierarchy levels), in my case, it’s “History” label string.

GTK warns me because Label text is not unique. Does it really should be?

let some_menu = gio::Menu::new();
// .. 
main.append_submenu(Some("History"), &some_children_one);
// ..
main.append_submenu(Some("History"), &some_children_two);

Hi,

It’s a known issue: Gtk.PopoverMenu does not work with submenus that have the same label (#7064) · Issues · GNOME / gtk · GitLab

The reason is because nested submenus internally use a GtkStack whose page names are just a copy of the menu label.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.