[Gtk-sharp-list] treeview helper
Alvaro A. Ramirez
alramire@ecs.syr.edu
Tue, 20 Jan 2004 01:42:11 -0500
I have the following class used to make handling a treeview of strings a
little easier. It derives from treeview. It seems that I cannot use an
array of strings when using AppendValues in ListStore. Is this normal
behavior? Isn't AppendValues supossed to accept arrays?
(<unknown>:12072): Gtk-WARNING **: gtkliststore.c:698: Unable to convert
from gchararray to GtkSharpValue
(<unknown>:12072): Gtk-CRITICAL **: file gtkliststore.c: line 791
(gtk_list_store_set_value): assertion `column >= 0 && column <
list_store->n_columns' failed
(<unknown>:12072): Gtk-CRITICAL **: file gtkliststore.c: line 791
(gtk_list_store_set_value): assertion `column >= 0 && column <
list_store->n_columns' failed
(<unknown>:12072): GLib-GObject-WARNING **: unable to set property
`text' of type `gchararray' from value of type `GtkSharpValue'
(<unknown>:12072): Gtk-CRITICAL **: file gtkliststore.c: line 568
(gtk_list_store_get_value): assertion `column < GTK_LIST_STORE
(tree_model)->n_columns' failed
(<unknown>:12072): GLib-GObject-CRITICAL **: file gobject.c: line 1019
(g_object_set_property): assertion `G_IS_VALUE (value)' failed
(<unknown>:12072): GLib-GObject-CRITICAL **: file gvalue.c: line 147
(g_value_unset): assertion `G_IS_VALUE (value)' failed
(<unknown>:12072): Gtk-CRITICAL **: file gtkliststore.c: line 568
(gtk_list_store_get_value): assertion `column < GTK_LIST_STORE
(tree_model)->n_columns' failed
(<unknown>:12072): GLib-GObject-CRITICAL **: file gobject.c: line 1019
(g_object_set_property): assertion `G_IS_VALUE (value)' failed
(<unknown>:12072): GLib-GObject-CRITICAL **: file gvalue.c: line 147
(g_value_unset): assertion `G_IS_VALUE (value)' failed
(<unknown>:12072): GLib-GObject-WARNING **: unable to set property
`text' of type `gchararray' from value of type `GtkSharpValue'
(<unknown>:12072): Gtk-CRITICAL **: file gtkliststore.c: line 568
(gtk_list_store_get_value): assertion `column < GTK_LIST_STORE
(tree_model)->n_columns' failed
(<unknown>:12072): GLib-GObject-CRITICAL **: file gobject.c: line 1019
(g_object_set_property): assertion `G_IS_VALUE (value)' failed
(<unknown>:12072): GLib-GObject-CRITICAL **: file gvalue.c: line 147
(g_value_unset): assertion `G_IS_VALUE (value)' failed
(<unknown>:12072): Gtk-CRITICAL **: file gtkliststore.c: line 568
(gtk_list_store_get_value): assertion `column < GTK_LIST_STORE
(tree_model)->n_columns' failed
(<unknown>:12072): GLib-GObject-CRITICAL **: file gobject.c: line 1019
(g_object_set_property): assertion `G_IS_VALUE (value)' failed
(<unknown>:12072): GLib-GObject-CRITICAL **: file gvalue.c: line 147
(g_value_unset): assertion `G_IS_VALUE (value)' failed
(<unknown>:12072): GLib-GObject-WARNING **: unable to set property
`text' of type `gchararray' from value of type `GtkSharpValue'
(<unknown>:12072): Gtk-CRITICAL **: file gtkliststore.c: line 568
(gtk_list_store_get_value): assertion `column < GTK_LIST_STORE
(tree_model)->n_columns' failed
using Gtk;
using Gdk;
using GLib;
using GtkSharp;
using System;
namespace GUITools
{
public class TreeViewEnhanced:Gtk.TreeView
{
public TreeViewEnhanced(string[] StringColumnsPar)
{
Model = new Gtk.ListStore(typeof(string[]));
int IntCounter=0;
foreach (string StringTemp in StringColumnsPar)
{
AppendColumn(StringTemp,new Gtk.CellRendererText(),"text",IntCounter);
IntCounter++;
}
}
public void AddRow(string[] StringValuesPar)
{
((Gtk.ListStore)Model).AppendValues(StringValuesPar);
}
}
}