gpt4 book ai didi

python - 将颜色设置为 wx.listbox 项目

转载 作者:太空宇宙 更新时间:2023-11-04 11:28:18 26 4
gpt4 key购买 nike

Wxpython 提供了以下 API 来改变 wx.listbox 项目的颜色:

wx.ListBox.SetItemBackgroundColour(self, item, c)

wx.ListBox.SetItemForegroundColour(self, item, c)

由于某些原因,这个函数在我的 linux 和 windows 上无法执行。有谁知道为什么吗?

请注意 wx.ListBox.SetOwnBackgroundColor 工作得很好。

最佳答案

我猜这是 native 小部件的限制。我见过几个你不能设置背景或前景色的小部件,因为那个小部件在那个平台上不支持它,但它在其他平台上支持它。不过,您可以在 wxPython 邮件列表上询问以确保。他们那里有一些主要的 wx 开发人员。

与此同时,您可能会查看 VListBox 或切换到 ListCtrl。

关于python - 将颜色设置为 wx.listbox 项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13105419/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com