Skip to Content
Python GUI Programming with Tkinter
book

Python GUI Programming with Tkinter

by Alan D. Moore
May 2018
Beginner to intermediate content levelBeginner to intermediate
452 pages
11h 26m
English
Packt Publishing
Content preview from Python GUI Programming with Tkinter

Responding to record selection

The purpose of this widget is for users to select and open records; therefore, we need a way to do that. It would be nice to be able to trigger this from an event like a double-click or keyboard selection.

The Treeview widget has three special events which we can use to trigger a callback as shown in the following table:

Event string
Triggered when
<<TreeviewSelect>> A row is selected, such as by clicking it with a mouse
<<TreeviewOpen>> A row is opened by a double-click or by selecting it and hitting Enter
<<TreeviewClose>> An open row is closed

 

<<TreeviewOpen>> sounds like the event we want; even though we're not using a hierarchical list, the user is still conceptually opening the record, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Python GUI Programming with Tkinter - Second Edition

Python GUI Programming with Tkinter - Second Edition

Alan D. Moore

Publisher Resources

ISBN: 9781788835886Supplemental Content