Skip to content Skip to sidebar Skip to footer

Generate A Click Event In Tkinter

I am tring to unittest my tkitner GUI. Therefore I tried to generate click events from a separate thread. Here is an example testing the Tkinter.Button: import unittest, threading

Solution 1:

If I recall correctly (and I may not since its been years since I tried this) the cursor needs to be over tne button for the binding to fire.

Are you aware of the "invoke" method of buttons? You can use it to simulate the pressing of the buttun.

Post a Comment for "Generate A Click Event In Tkinter"