Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Why is a handler connected to a GtkRadioButton being called twice?

called connected handler twice
0
Posted

Why is a handler connected to a GtkRadioButton being called twice?

0

The GtkRadioButton is a bit wierd, because it triggers the clicked signal both when it’s selected and when it’s unselected (i.e. it is triggered when there is a state transition in it). In practical terms, this means that if there is a currently selected item (item A) in a radiobutton group and you select another one (item B), a signal clicked will be generated for item A and for item B. Inside the handler, you can use radiobutton.active to check its state: if it is TRUE, it’s been selected, and vice-versa.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123