GtkListStore with GtkBuilder



sorry for second mail since first one was from non member mail id
Hi,
I have a Liststore with two columns first is a Pixbuf and second is a string column.
When i want to populate this Liststore through ui i always need to specify both fields.
but for some row if i don't want to show Pixbuf i can't do it. I always need to specify both columns.
If i specify wrong filename or NULL Gtk will show GTK_STOCK_MISSING_IMAGE.

And if i does not Pixbuf column then GtkListstore tries to set the string part (second col) as pixbuf in first column.
When i looked in GtkListStore code I think their is mismatch in column type and passed GValue which is to filled by calling
gtk_builder_value_from_string_type.

I am attaching a patch (with correct index) for above case.It works fine in my case but needs to verify it with other scenarios.

Can't we miss any column(any one of many) which is not needed for that particular row.

Regards,
Amol

Index: gtkliststore.c
===================================================================
--- gtkliststore.c	(revision 16714)
+++ gtkliststore.c	(working copy)
@@ -2197,7 +2197,7 @@
 
   string = g_strndup (text, text_len);
   if (!gtk_builder_value_from_string_type (data->builder,
-					   data->column_types[i],
+					   data->column_types[data->columns[i]],
 					   string,
 					   &data->values[i],
 					   &tmp_error))


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]