I am working with a gnome extension which has a toggle switch on its panel popup menu. I have bound a keyboard shortcut to the same setting, so I want to change the state of the toggle to reflect what happens with the keyboard shortcut.
the toggle comes from code like this:
let toggle = new PopupSwitchMenuItem(desc, active);
and I can save a reference to toggle so that is known to the code that handles the keyboard short cut. But I don’t know how to change the state, and neither do I know how to bind the switch so that it can notice a change in state to the extension settings object.
I hoped toggle.set_state(true) might work, but whatever object toggle is, it does not support set_state()