I'm trying to create a Listbox
in Tkinter that has columns.
I'm returning from a DB query records and would like to display each entry in it's own column for each record.
Looking at Listbox
, I feel like there should be this functionality there but can't find it. What widget should I be using to do this? I've been searching around online but documentation has been very sparse.
Using TkTreectrl:
yields
You can use Ttk/Tkinker
Treeview
widget, which is used to work with tabular data.The following is an example of a class that uses a
Treeview
widget to display a multi-column list of strings:These are some pictures of the result of using a
Treeview
widget:One simple solution is to use two listboxes side-by-side. There's no real magic, you just have to do a little bit of extra work to get one scrollbar to control both (easily done) and have the selection in the two sync up (also easily done).