I have a menu with a few RadioMenuItems.
After the user selects an option, my program reloads the menu and therefore also resets the pointer to the selected item.
I need to programmatically set it back but without activating the function connected to it. RadioMenuItem.set_active(True) will activate the function. In fact, it seems that my function is called even when I do not call set_active, even just when the menu is drawn.
How do?
Turns out active was the wrong signal to connect to a RadioMenuItem, even though it works perfectly fine for a regular MenuItem.
Instead, connecting the toggled signal, and then checking in the callback function whether the widget's get_active() function returns True, results in the desired behaviour.
how to set a Gtk RadioMenuItem as 'selected' without activating it