From the course: Python GUI Development with Tkinter

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

Handling user events

Handling user events

From the course: Python GUI Development with Tkinter

Start my 1-month free trial

Handling user events

- [Instructor] After we've created widgets and displayed them in our application with the Geometry Manager the last thing we'll need to do is tell the program what to do when the user interacts with that widget. A user interface that doesn't respond to user's actions wouldn't be very exciting. Tkinter uses a process called Event Handling to execute specific functions when certain inputs are received from the mouse, keyboard, and other sources. In your Tkinter program you'll configure the specific events your program will listen for and respond to. These events can be things like mouse clicks, key strokes, widget interactions, mouse movement, window resizing, and so on. For each possible event the program is concerned with it will need to define a handler method or function that'll be executed when that event occurs. For example, if your program has a form for the user to fill out with a Submit button the program will need to bind the event of that button being pressed to execute a…

Contents