summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2004-07-30 20:55:17 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2004-07-30 20:55:17 +0000
commit1f93c4359cee608ffd2914ae6ff6c5635bdce737 (patch)
tree0830f9be3f9e24839390406c15f4b2e3ca94e88f /tests
parent9b7e23e9f6f1e89dd669e0ab145c4ce87b8becc2 (diff)
downloadgtk+-1f93c4359cee608ffd2914ae6ff6c5635bdce737.tar.gz
Change the api for separators to use a separator function instead of a
2004-07-30 Matthias Clasen <mclasen@redhat.com> * gtk/gtkcombobox.h: * gtk/gtkcombobox.c: Change the api for separators to use a separator function instead of a boolean column. * tests/testcombo.c: Update to match the api change.
Diffstat (limited to 'tests')
-rw-r--r--tests/testcombo.c27
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);