diff options
Diffstat (limited to 'tests/testcombo.c')
-rw-r--r-- | tests/testcombo.c | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/tests/testcombo.c b/tests/testcombo.c index fd8555485a..b666b94011 100644 --- a/tests/testcombo.c +++ b/tests/testcombo.c @@ -128,7 +128,7 @@ create_blaat () cellview = gtk_cell_view_new (); - store = gtk_list_store_new (3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_BOOLEAN); + store = gtk_list_store_new (2, GDK_TYPE_PIXBUF, G_TYPE_STRING); pixbuf = gtk_widget_render_icon (cellview, GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_BUTTON, NULL); @@ -136,7 +136,6 @@ create_blaat () gtk_list_store_set (store, &iter, 0, pixbuf, 1, "gtk-stock-dialog-warning", - 2, FALSE, -1); pixbuf = gtk_widget_render_icon (cellview, GTK_STOCK_STOP, @@ -145,7 +144,6 @@ create_blaat () gtk_list_store_set (store, &iter, 0, pixbuf, 1, "gtk-stock-stop", - 2, FALSE, -1); pixbuf = gtk_widget_render_icon (cellview, GTK_STOCK_NEW, @@ -154,7 +152,6 @@ create_blaat () gtk_list_store_set (store, &iter, 0, pixbuf, 1, "gtk-stock-new", - 2, FALSE, -1); pixbuf = gtk_widget_render_icon (cellview, GTK_STOCK_CLEAR, @@ -163,14 +160,12 @@ create_blaat () gtk_list_store_set (store, &iter, 0, pixbuf, 1, "gtk-stock-clear", - 2, FALSE, -1); gtk_list_store_append (store, &iter); gtk_list_store_set (store, &iter, 0, NULL, 1, "separator", - 2, TRUE, -1); pixbuf = gtk_widget_render_icon (cellview, GTK_STOCK_OPEN, @@ -179,7 +174,6 @@ create_blaat () gtk_list_store_set (store, &iter, 0, pixbuf, 1, "gtk-stock-open", - 2, FALSE, -1); gtk_widget_destroy (cellview); @@ -223,6 +217,22 @@ set_sensitive (GtkCellLayout *cell_layout, g_object_set (cell, "sensitive", sensitive, NULL); } +static gboolean +is_separator (GtkTreeModel *model, + GtkTreeIter *iter, + gpointer data) +{ + GtkTreePath *path; + gboolean result; + + path = gtk_tree_model_get_path (model, iter); + result = gtk_tree_path_get_indices (path)[0] == 4; + gtk_tree_path_free (path); + + return result; + +} + int main (int argc, char **argv) { @@ -318,7 +328,8 @@ main (int argc, char **argv) renderer, set_sensitive, NULL, NULL); - gtk_combo_box_set_row_separator_column (GTK_COMBO_BOX (combobox), 2); + gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (combobox), + is_separator, NULL, NULL); gtk_combo_box_set_active (GTK_COMBO_BOX (combobox), 0); |