是否可以在 wxPython 中制作手风琴样式检查表? [英] Is it possible to make an accordion style check list in wxPython?

查看:9
本文介绍了是否可以在 wxPython 中制作手风琴样式检查表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 wxPython 小部件中制作一个手风琴风格的清单.我知道 checklistbox,但我在官方文档中找不到任何关于它的内容.有人做过吗?

I want to make a checklist with a accordion style in a wxPython widget. I know about checklistbox, but I couldn't find anything in the official docs concerning it. Has anyone done this?

推荐答案

你可以使用 wx.combo.ComboCtrl 它允许任何自定义弹出窗口,并将其与 wx.CheckListBox 结合.

You can use a wx.combo.ComboCtrl which allows any custom popup, and combine this with a wx.CheckListBox.

折叠后的样子:

并展开:

为了实现这一点,我从演示中的 ComboCtrl 示例开始,在 ListCtrlComboPopup 列表类中,我将 ListCtrl 替换为 CheckListBox(并进行了其他一些小的更改以使命令与 CheckListBox 控件一致,而不是 ListCtrl).

To get this, I started with the ComboCtrl example in the demo, and in the ListCtrlComboPopup list class I replaced ListCtrl with CheckListBox everywhere (and made a few other small changes to make the commands consistent with a CheckListBox control rather than a ListCtrl).

这篇关于是否可以在 wxPython 中制作手风琴样式检查表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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