I'm using Radiobuttons in tkinter and I can select them fine but when the mouse hovers over one of the options it gets selected without me actually clicking the left button on the mouse.
from tkinter import *
p = Tk()
def select_months():
new_window = Toplevel()
new_window.resizable(width=FALSE, height=FALSE)
days_label = Label(new_window,text="Select month")
days_label.grid()
ycolumn = 0
xrow = 1
list_of_months = ["January", "February ", "March ", "April "]
list_of_months_variable = StringVar()
# list_of_months_variable.set(None)
for i in list_of_months:
Radiobutton(new_window, text=i, variable=list_of_months_variable, value=str(i)).grid(padx=4, row=xrow, column=ycolumn)
ycolumn += 1
if ycolumn > 2:
ycolumn = 0
xrow += 1
ok_button = Button(new_window, text="OK", command=new_window.destroy).grid()
select_month_label = Label(p,text="which month ? : ").pack(side="left")
select_month_button = Button(p, text="months...", command=select_months).pack()
p.mainloop()