From 6ab532669fea14ae28f6f04a90eb9761d79f71d5 Mon Sep 17 00:00:00 2001 From: Darren Vincent Hart Date: Sun, 26 Jul 2009 20:30:12 -0700 Subject: [PATCH] Reset combobox attributes 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 --- gui/widgets.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gui/widgets.py b/gui/widgets.py index 53977ac..6a945a5 100644 --- a/gui/widgets.py +++ b/gui/widgets.py @@ -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) @@ -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()