开发者

Expandable List using Python Tkinter

开发者 https://www.devze.com 2023-03-04 19:53 出处:网络
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 +

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 i开发者_Go百科mplement this type of expandable list using Tkinter or if not if there was a different Python GUI tool that could do so?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号