Tkinter #11: RadioButtons
RadioButtons in Tkinter
Radio buttons are used to make choice of various things. Radio buttons are like a check button they are quite similar to each other.
To create radio button the we must have to write:
- text(that displays on the screen)
- variable(Which type of value we want from it)
- value(The value return by the checkbox when it is submitted)
without this parameter it will raise some error
syntax
button = Radiobutton(master, text=”Name on Button”, variable = “shared variable”, value = “values of each button”, options = values, …)
shared variable = A Tkinter variable shared among all Radio buttons
value = each radio button should have a different values otherwise more than 1 radio button will get selected.
some other parameters are same like bg,fg,bd
But there are two types of radiobuttons
1.)Buttons like a button , for this add parameter indicator=0
2.)Other are made by shown above method.
Comments
Post a Comment