From the course: Python GUI Development with Tkinter
Unlock the full course today
Join today to access over 24,600 courses taught by industry experts.
Adding columns and selecting items in the Treeview
From the course: Python GUI Development with Tkinter
Adding columns and selecting items in the Treeview
- [Instructor] In the previous video we learned how to add and remove items from the hierarchal structure of a treeview. In this video we'll continue from where that example left off to learn how to add additional columns to the treeview which can be used to display information about the tree's items. We'll also learn how to use the bind method to capture the special event that occurs when the user selects an item from the treeview. To add new columns to the treeview, configure the columns property. I'll say treeview.config columns and you pass the columns property a list of the names of the columns you want to include. So I'm going to just include one additional column called version. And you can see that got added here, it doesn't have a title yet, but you'll see a small divider in the middle between the two columns. To configure the properties of a column we'll use the column method of the treeview. With a column method the first paramter is the name of the column we want to…
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.
Contents
-
-
-
-
-
-
-
(Locked)
Entering and displaying multiple lines with the Text widget11m 31s
-
(Locked)
Adding tags, marks, images, and widgets to the Text widget9m 57s
-
(Locked)
Building a hierarchical treeview7m 19s
-
(Locked)
Adding columns and selecting items in the Treeview7m 12s
-
(Locked)
Building cascading menus11m 5s
-
(Locked)
Drawing a basic line on the Canvas5m 21s
-
(Locked)
Drawing complex shapes on the Canvas9m 58s
-
(Locked)
Attaching a scroll bar to widgets6m 21s
-
(Locked)
Configuring widget styles9m 49s
-
(Locked)
Prompting users with the Messagebox and dialogs6m 11s
-
(Locked)
-
-
-
-