开发者

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 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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜