【发布时间】:2014-06-25 08:54:26
【问题描述】:
我真的在努力寻找一个示例来创建 Enum 并将其作为模型发送到 ComboBoxEntry。
有人可以上传正确方法的示例吗?
这是我的代码的开头:
model = "one", "two", "three"
liststore = gtk.ListStore(str)
for item in model:
liststore.append([item])
cbe = gtk.ComboBoxEntry(liststore)
我希望 model 成为能够编写的枚举:
# for example:
cbe.set_active(one)
# or
if cbe.get_active() == model.one: ...
非常感谢
【问题讨论】:
标签: python-2.7 combobox enums pygtk