Nov-23-2021, 03:33 PM
(This post was last modified: Nov-23-2021, 04:46 PM by Yoriz.
Edit Reason: Added code tags
)
Hi,
How can I position the radio buttons with with grid command and rows and col
How can I position the radio buttons with with grid command and rows and col
import tkinter as tk root = tk.Tk() var_1 = tk.IntVar() var_2 = tk.IntVar() tk.Label(root, text="""Radio Buttons""", justify = tk.LEFT, padx = 20).pack() tk.Radiobutton(root, text="A", padx = 20, variable=var_1, value=1).pack(anchor=tk.W) tk.Radiobutton(root, text="B", padx = 20, variable=var_1, value=2).pack(anchor=tk.W) tk.Radiobutton(root, text="C", padx = 20, variable=var_2, value=1).pack(anchor=tk.W) tk.Radiobutton(root, text="D", padx = 20, variable=var_1, value=2).pack(anchor=tk.W) root.mainloop()