使用Python和Tkinter的水平方向列表框 [英] Horizontally oriented listbox using Python and Tkinter

查看:54
本文介绍了使用Python和Tkinter的水平方向列表框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想提供一个列表框,用户可以在其中选择(多个)字符(通常接近15个).其中的一些经常会被排序,因此列表框比经过验证的文本输入字段更容易.

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.

有没有简单的方法,例如Tkinter列表框的主题,设置或子类,所以我不必自己构建?

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?

推荐答案

不,没有设置,子类或主题可以让您使用列表框来做到这一点.

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.

这篇关于使用Python和Tkinter的水平方向列表框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆