Navigation Menu

Skip to content

Commit

Permalink
Reset combobox attributes
Browse files Browse the repository at this point in the history
Glade does some initial setup of the gtk.ComboBox which causes the long
standing and VERY ANNOYING:

Warning: unable to set property `text' of type `gchararray' from value of type `PyObject'

These appear now to be fixed.

Signed-off-by: Darren Hart <darren@dvhart.com>
  • Loading branch information
dvhart committed Jul 27, 2009
1 parent 5152f56 commit 6ab5326
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions gui/widgets.py
Expand Up @@ -607,6 +607,12 @@ class GTDFilterCombo(WidgetWrapper):
def __init__(self, name, model):
WidgetWrapper.__init__(self, name)
debug('%s model is %s' % (name, model.__class__.__name__))

# Glade apparently does some setup, and binds attribute text to col 0
# this throws gobject errors trying to convert a PyObject to a
# chararray.
self.widget.clear()

self.widget.set_model(model)
renderer = gtk.CellRendererText()
self.widget.pack_start(renderer)
Expand Down Expand Up @@ -635,6 +641,12 @@ def __init__(self, name, model, none=None):
WidgetWrapper.__init__(self, name)
self.__none = none
debug('%s model is %s' % (name, model.__class__.__name__))

# Glade apparently does some setup, and binds attribute text to col 0
# this throws gobject errors trying to convert a PyObject to a
# chararray.
self.widget.clear()

self.widget.set_model(model.model_filter)
model.model_filter.connect("row_changed", lambda m,p,i: self.widget.queue_draw)
renderer = gtk.CellRendererText()
Expand Down

0 comments on commit 6ab5326

Please sign in to comment.