From the course: Python GUI Development with Tkinter
Unlock the full course today
Join today to access over 24,700 courses taught by industry experts.
Configuring command callbacks
From the course: Python GUI Development with Tkinter
Configuring command callbacks
- Many of the Tk widgets need to perform an action when the user interacts with them. A prime example of this is the button widget. When the user clicks on a button they expect it to do something, and if you place a button on your GUI that doesn't do anything, you'll just end up frustrating your users. To make a button, or certain other types of input widgets perform an action when the user interacts with them you need to configure a command callback for that widget. The callback is a function or method that will be executed when the button is clicked. We've already seen command callbacks used in some earlier videos about widgets, but I usually just glossed over what was happening when we configured the various command properties. In this video, you'll learn how to properly use them, and know which widgets support different types of command callbacks. I'll begin by going to the exercise folders in the Chapter Seven folder, and creating a copy of the template file. I'll rename that…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.