Menu item for GAction always disabled (gtk_widget_insert_action_group)
Menu items for actions added using gtk_widget_insert_action_group()
are always disabled, even if the action is available.
Steps to reproduce
- Add an action "foo" to a
GSimpleActionGroup group
. - Attach group to a
widget
viagtk_widget_insert_action_group(widget, "group", group);
- Add a menu item for "group.foo" to the application menubar.
See the attached example. In addition to adding a menu item, the example also adds a shortcut "a" for the same action, to prove that the fault lies within the menu, not the binding of the action. When you press "a" inside the left GtkEntry, "Hello World" is printed to the console. This proves that the action is in fact available. So the menu item should also reflect this. Despite this, the menu item is disabled.
Current behavior
The menu item for "group.foo" is disabled. Clicking on it does nothing.
Expected outcome
The menu item for "group.foo" should be enabled. Clicking on it should print "Hello World" to the console.
Version information
GTK 3.24.8
Additional information
Compile the example with gcc $(pkg-config --cflags --libs gtk+-3.0) gtk3-action.c -o gtk3-action