I'm trying to connect up an accelerator to a Gtk::ToggleToolButton, unfortunately the "toggle" signal isn't 'activatable' and so you must connect to "clicked" instead like so:
togglebutton->add_accelerator("clicked", ...etc..)
This works, and fires whatever handler is connected to signal_clicked() but, it doesn't actually change the appearance of the button, or fire the "toggled" signal. Basically firing "clicked" doesn't change the "active" state of the button.
So, the obvious solution is to call toolbutton->set_active(true/false) from inside the "clicked" callback. But the problem now is that set_active itself fires the "clicked" signal and the "toggled" signal, so you end up in an infinite loop of:
accelerator -> clicked handler -> set_active() -> clicked handler -> set_active()
So, my question is, how can I add an accelerator to a ToggleToolButton which results in the expected behaviour of toggling the button?