Python Forum

Full Version: 2 sets of radiobuttons
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

have looked ont web, but I can't seem to find a definite answer.

Have a pair of radio buttons:

rad_lt = Radiobutton(root,text='Lighting circuit',value=1)
rad_nonlt = Radiobutton(root,text='Non-lighting circuit',value=2)

Works fine.

I want to add a separate set of radio buttons, completely separate from above.

If I give them values of 3 and 4, then you can only choose one of the 4 radiobuttons. I want to be able to choose 1 from each set.

Pointers? What don't I know?

Okay what are you using ?? TKinter, WxPython, PySide2, PyQt ???
Ok. Yes, missing info.
Quote:I want to be able to choose 1 from each set
The reason you use a radiobutton is that you want one, and only one. selection. You will have to have the user choose one from group "A" and then delete these and present group "B". It would be more straight forward to use chechbuttons and when the selection is finished. check that one, and only one, but is selected from group "A" and one from "B".
I do not know TKinter but Qt has a means of grouping radio buttons such that you have Group1 and Group2 and etc... I would assume TKinter has something similar-ish