Search code examples
pythontkintereventsvirtual

Tkinter Radiobutton Virtual "Click" (event)


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.


Solution

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

    button = tk.Radiobutton()
    button.invoke()