【发布时间】:2011-09-10 12:22:38
【问题描述】:
使用 pygtk 2.24 和 glade 3 我在使用组合框时遇到了问题。当我点击其中的一个项目时,我收到以下错误消息
interface.py:94: Warning: unable to set property `text' of type `gchararray' from
value of type `glong'
gtk.main()
我的组合框代码在这里
#get the combo box out of the builder and add items to it
self.cbmoRepresentation = builder.get_object("cmbo_representation")
self.iface_list_store = gtk.ListStore(gobject.TYPE_STRING)
self.iface_list_store.append(["Row-Column"])
self.iface_list_store.append(["Row-Number"])
self.iface_list_store.append(["Number-Column"])
self.cbmoRepresentation.set_model(self.iface_list_store)
cell = gtk.CellRendererText()
self.cbmoRepresentation.pack_start(cell, True)
self.cbmoRepresentation.add_attribute(cell, "text", 0)
self.cbmoRepresentation.set_active(-1)
任何帮助将不胜感激:)。
【问题讨论】:
-
你能解决这个问题吗?
标签: python combobox gtk pygtk glade