[Tkinter-discuss] Focus issue

Michael Lange klappnase at web.de
Wed Jan 10 18:51:53 EST 2024


Hi,

On Wed, 10 Jan 2024 16:33:46 -0400
Cam Farnell <msa01 at bitflipper.ca> wrote:

> To answer my own question: the focus was being given to another widget
> after the code in question had executed.
>
> That said, I still don't understand why focus_set followed by
> update_idletasks followed by focus_get would return None, but tkinter
> something works in strange and mysterious ways.
>

I can only guess here, have you tried calling update_idletasks() (or even
update()) *before* calling focus_set() ?

Best regards,

Michael


More information about the Tkinter-discuss mailing list