devonbleibtrey
devonbleibtrey

Reputation: 1587

Expandable List using Python Tkinter

I know how to create a Listbox using Tkinter but this only allows me to display a list of single items. I need to create a expandable list that allows the user to hit something along the lines of a + next to the item which in turn opens up a new list with + buttons next to each item until you reach the leaf of a list. I was wondering if there was a way to implement this type of expandable list using Tkinter or if not if there was a different Python GUI tool that could do so?

Upvotes: 2

Views: 3781

Answers (1)

Bryan Oakley
Bryan Oakley

Reputation: 385890

The widget you are looking for is commonly called a "tree" or "hierarchical tree".

If you're using python2.7 or greater you can use ttk.Treeview widget.

For older versions of python you can use Tix.Tree. You can also search for "tkinter tree" on google and you'll find several other variations such as this one.

Upvotes: 2

Related Questions