Horizontally oriented listbox using Python and Tkinter

怎甘沉沦 提交于 2020-03-25 19:08:31

问题


I want to provide a listbox where the user can select (multiple) characters (usually close to 15). Quite often some of these will be sequenced, so a listbox is easier than a validated text entry field.

Since the character combination has a meaning to the user, it is user friendly to orient the listbox horizontally.

Is there an easy way e.g. a theme, setting or subclass of the Tkinter listbox so I do not have to build my own?


回答1:


No, there is no setting, subclass or theme that will let you do that with a listbox.

What you might want to use instead is a set of check buttons with the indicator turned off so they each appear as a button with a single letter. You can then pack them all horizontally in a frame. With the indicator off, the button will appear sunken when selected, or normal otherwise.



来源:https://stackoverflow.com/questions/6082723/horizontally-oriented-listbox-using-python-and-tkinter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!