Python 在组合框pygtk glade3中选择项目

Python 在组合框pygtk glade3中选择项目,python,combobox,gtk,pygtk,glade,Python,Combobox,Gtk,Pygtk,Glade,使用PyGTK2.24和Glade3,我在组合框方面遇到了问题。当我点击其中的一个项目时,我得到以下错误消息 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.cbmo

使用PyGTK2.24和Glade3,我在组合框方面遇到了问题。当我点击其中的一个项目时,我得到以下错误消息

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)
任何帮助都将不胜感激:)。

我有一个有效的方法(但我不使用glade):

所以我怀疑你的自我介绍不是正确的类型。 请尝试:

  self.cbmoRepresentation = builder.get_object("cmbo_representation")
  print type(self.cbmoRepresentation)

检查cbmoRepresentation的类型。

是输出。您是否能够解决此问题?
  self.cbmoRepresentation = builder.get_object("cmbo_representation")
  print type(self.cbmoRepresentation)