Re: Focus issue

Michael Lange via Tkinter-discuss <[email protected]> Thu, 11 Jan 2024 00:51:53 +0100
Newsgroups gmane.comp.python.tkinter
Message-ID <[email protected]>
Hi,

On Wed, 10 Jan 2024 16:33:46 -0400
Cam Farnell <[email protected]> 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