[Tutor] Focus in tkinter

Michael Lange klappnase at freenet.de
Wed Sep 14 21:54:06 CEST 2005

On Wed, 14 Sep 2005 19:58:07 +0100 (BST)
David Holland <davholla2002 at yahoo.co.uk> wrote:

> I want to make the mouse focus in a GUI move to the
> correct button/text entry widget.  Does anyone know
> how to do this ?

Hi David,

to set the focus to a particular widget you need the focus_Set() method:

b = Button(parent)

Maybe you want to have a look at Frederik Lundh's excellent Tkinter books:


or the more complete, but a little outdated version:


I hope this helps


More information about the Tutor mailing list