Hi all,
Is there a way to switch all buttons in the group simulteniously?
something like SetButton(kAll).


This cannot be done because if you have radio buttons that are mutually exclusive when grouped in logical sets; only one setting is permitted at time. So, the answer is negative.

Cheers, Ilka


But if this set contains check buttons, it’s rather convinient to swittch on-off all of them in some cases. So might be possible to introduce this feature if logic set of buttons contains no radio buttons or they are set not to be mutually exclusive?

Hi Kirill,

Because you know better your application in this case you can use the method SetButton(Int_t id, kTRUE):

   for (i = 0; i < last_button_id; ++i) {
      fGr->SetButton(i, kTRUE);

fGr is the button group pointer.

Cheers, Ilka


SetButton(id, kTRUE) will sets the button with ‘id’ to be ON, kFALSE - sets it OFF.


your code forces to get those id’s as a continious list 0,1,2…
while sometimes it’s not convinient.

Hi Kiril,

My code was based on your very first question 'how to switch all buttons in the group simulteniously" and the possibility to use the default button identifiers created via Insert method. There is another TGButtonGroup methods that might be used for more complex cases. Please see: for more details.

Cheers, Ilka