If I use tkinter
, I can set the option indicatoron = 0
, and get an expected effect.
This effect can be achieved with a group of QPushButton
, and some additional code, I suppose.
But is it a true way? Maybe, PyQt
has an option, as tkinter
?
This code gave me an expected effect from tkinter.
from tkinter import *
root = Tk()
var = IntVar()
button1 = Radiobutton(root,indicatoron=0,text=' One Button ',variable=var,value=1)
button2 = Radiobutton(root,indicatoron=0,text=' Two Button ',variable=var,value=2)
button3 = Radiobutton(root,indicatoron=0,text='Three Button',variable=var,value=3)
button1.place(x=4, y=4)
button2.place(x=4, y=30)
button3.place(x=4, y=56)
mainloop()
In PyQt, you can use
QPushButton
and aQButtonGroup
: