summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené Stadler <mail@renestadler.de>2009-03-10 00:46:24 +0200
committerRené Stadler <mail@renestadler.de>2009-03-10 01:21:01 +0200
commitc364b0e88828839d384a58ba5975d72ed89a727b (patch)
tree16bfbf3b0b19342dea3860e309d48ffb6298135b
parent0c1d78d8a6fe6d361b3fe5ca4df9acdb95048558 (diff)
filters: Fix abuse of GtkComboBoxEntry private internal cell renderer
Somehow the migration to GtkBuilder uncovered that I was misusing the combo box entry widget: Because it requires a text column, it has its own internal text cell renderer which I was removing with clear().
-rw-r--r--GstInspector/GUI/filters.py30
1 files changed, 20 insertions, 10 deletions
diff --git a/GstInspector/GUI/filters.py b/GstInspector/GUI/filters.py
index b79b277..7f80256 100644
--- a/GstInspector/GUI/filters.py
+++ b/GstInspector/GUI/filters.py
@@ -286,6 +286,19 @@ class UIFilterCombo (UIFilter):
UIFilter.__init__ (self, manager, widgets)
+ self.widget.props.model = self.model
+
+ self.setup_cell_renderer ()
+
+ self.default_param = self.get_initial_default ()
+ if self.default_param is not None:
+ self.param = self.default_param
+ self.default_param = None
+
+ self.widget.connect ("changed", self.handle_combo_box_changed)
+
+ def setup_cell_renderer (self):
+
cell = gtk.CellRendererText ()
# We limit the width to 35 characters. The automatic size is far too
# large because of some semi-bogus entries we get (like URLs and almost
@@ -297,14 +310,6 @@ class UIFilterCombo (UIFilter):
widget.clear ()
widget.pack_start (cell, True)
widget.set_cell_data_func (cell, self.combo_cell_data_func)
- widget.props.model = self.model
-
- self.default_param = self.get_initial_default ()
- if self.default_param is not None:
- self.param = self.default_param
- self.default_param = None
-
- widget.connect ("changed", self.handle_combo_box_changed)
def get_initial_default (self):
@@ -414,8 +419,6 @@ class UIFilterCapsName (UIFilterComboNested):
self.id = None
- self.widget.set_row_separator_func (self.row_separator_func)
-
flat_model = self.model_factory.flat_model
entry = self.widget.get_child ()
comp = gtk.EntryCompletion ()
@@ -427,6 +430,13 @@ class UIFilterCapsName (UIFilterComboNested):
comp.props.popup_completion = False
entry.set_completion (comp)
+ def setup_cell_renderer (self):
+
+ widget = self.widget
+
+ widget.props.text_column = 0
+ widget.set_row_separator_func (self.row_separator_func)
+
def get_initial_default (self):
return ""