Tkinter Radiobutton Virtual "Click" (event)

Question:

I’m crazy searching for doing this for days and days…

I need to simulate a virtual click on a Tkinter RadioButton.

In other words. Just when my application starts I need some virtual click event on a radiobutton to force a code execution. I would need my radiobutton in a second option but like if an user had clicked on it.

I readed some stuff abou virtual events but not in Radiobuttons…

Can anyone help me?

Thank you very much.

Asked By: nastiliano

||

Answers:

It wouldn’t be easy to create a virtual event, but you could just run your function on code startup, and than do something like

button = tk.Radiobutton(text="button", command=<Your Command>)
button.select()
Answered By: KaliMachine

Sounds to me like you want the invoke() method – it simulates clicking the button

button = tk.Radiobutton()
button.invoke()
Answered By: JRiggles
Categories: questions Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.