I am trying to figure out how to make a set of menu items which have radio action. My best attempt so far is something along the following lines. First create the action group and add the actions:
Radio items should use the same action, with different targets. I’m not familiar with that glibmm API, but a single add_action_radio_integer() per radio group should work.
In your menu XML, you can set the target attribute differently for each radio item:
For future reference and anyone else stuck on the same problem: I was under the wrong impression that I should create a Gio::SimpleAction for every possible value of the radio group. But the logic is instead that you create one such action (with the default value),
I’ll also note that GtkApplicationWindow is also a GApplicationMap, so you don’t need the separate action group. You can add the action directly to the window, where its prefix would be win.