aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-01-09 02:19:35 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-01-09 02:20:28 +0800
commit3e09259db4cc5f557d5a58268f321c6f88307c32 (patch)
treec5a28b696210a737717767c456ea20bdcefeefa0 /widgets
parent32ae20479caba1a10c344070501e3b0c7caf4a80 (diff)
downloadgsoc2013-evolution-3e09259db4cc5f557d5a58268f321c6f88307c32.tar.gz
gsoc2013-evolution-3e09259db4cc5f557d5a58268f321c6f88307c32.tar.zst
gsoc2013-evolution-3e09259db4cc5f557d5a58268f321c6f88307c32.zip
EActionComboBox: Fix runtime warnings with GTK3.
GtkComboBox changed some implementation details, apparently.
Diffstat (limited to 'widgets')
-rw-r--r--widgets/misc/e-action-combo-box.c55
1 files changed, 33 insertions, 22 deletions
diff --git a/widgets/misc/e-action-combo-box.c b/widgets/misc/e-action-combo-box.c
index cdf962d8de..ee88b7d199 100644
--- a/widgets/misc/e-action-combo-box.c
+++ b/widgets/misc/e-action-combo-box.c
@@ -349,6 +349,38 @@ action_combo_box_finalize (GObject *object)
}
static void
+action_combo_box_constructed (GObject *object)
+{
+ GtkComboBox *combo_box;
+ GtkCellRenderer *renderer;
+
+ combo_box = GTK_COMBO_BOX (object);
+
+ /* This needs to happen after constructor properties are set
+ * so that GtkCellLayout.get_area() returns something valid. */
+
+ renderer = gtk_cell_renderer_pixbuf_new ();
+ gtk_cell_layout_pack_start (
+ GTK_CELL_LAYOUT (combo_box), renderer, FALSE);
+ gtk_cell_layout_set_cell_data_func (
+ GTK_CELL_LAYOUT (combo_box), renderer,
+ (GtkCellLayoutDataFunc) action_combo_box_render_pixbuf,
+ combo_box, NULL);
+
+ renderer = gtk_cell_renderer_text_new ();
+ gtk_cell_layout_pack_start (
+ GTK_CELL_LAYOUT (combo_box), renderer, TRUE);
+ gtk_cell_layout_set_cell_data_func (
+ GTK_CELL_LAYOUT (combo_box), renderer,
+ (GtkCellLayoutDataFunc) action_combo_box_render_text,
+ combo_box, NULL);
+
+ gtk_combo_box_set_row_separator_func (
+ combo_box, (GtkTreeViewRowSeparatorFunc)
+ action_combo_box_is_row_separator, NULL, NULL);
+}
+
+static void
action_combo_box_changed (GtkComboBox *combo_box)
{
GtkRadioAction *action;
@@ -380,6 +412,7 @@ e_action_combo_box_class_init (EActionComboBoxClass *class)
object_class->get_property = action_combo_box_get_property;
object_class->dispose = action_combo_box_dispose;
object_class->finalize = action_combo_box_finalize;
+ object_class->constructed = action_combo_box_constructed;
combo_box_class = GTK_COMBO_BOX_CLASS (class);
combo_box_class->changed = action_combo_box_changed;
@@ -398,30 +431,8 @@ e_action_combo_box_class_init (EActionComboBoxClass *class)
static void
e_action_combo_box_init (EActionComboBox *combo_box)
{
- GtkCellRenderer *renderer;
-
combo_box->priv = E_ACTION_COMBO_BOX_GET_PRIVATE (combo_box);
- renderer = gtk_cell_renderer_pixbuf_new ();
- gtk_cell_layout_pack_start (
- GTK_CELL_LAYOUT (combo_box), renderer, FALSE);
- gtk_cell_layout_set_cell_data_func (
- GTK_CELL_LAYOUT (combo_box), renderer,
- (GtkCellLayoutDataFunc) action_combo_box_render_pixbuf,
- combo_box, NULL);
-
- renderer = gtk_cell_renderer_text_new ();
- gtk_cell_layout_pack_start (
- GTK_CELL_LAYOUT (combo_box), renderer, TRUE);
- gtk_cell_layout_set_cell_data_func (
- GTK_CELL_LAYOUT (combo_box), renderer,
- (GtkCellLayoutDataFunc) action_combo_box_render_text,
- combo_box, NULL);
-
- gtk_combo_box_set_row_separator_func (
- GTK_COMBO_BOX (combo_box), (GtkTreeViewRowSeparatorFunc)
- action_combo_box_is_row_separator, NULL, NULL);
-
combo_box->priv->index = g_hash_table_new_full (
g_direct_hash, g_direct_equal,
(GDestroyNotify) NULL,