Re: how to add a column to a GtkListStore
- From: edward hage <edha xs4all nl>
- To: gtk-app-devel-list gnome org
- Subject: Re: how to add a column to a GtkListStore
- Date: Thu, 16 Dec 2004 00:02:10 +0100
>>I have an application in which I have a GtkListStore with a variable amount of rows. If I
>> create a new element in my app than I also want to create a new row which shows the
new data.
>>
>> Now I create a new row by creating a new model with gtk_list_store_new(1, G_TYPE_DOUBLE)
>> and than place that model in a gtk_hbox next to its brothers. This looks like a single
>> table with more columns, but in fact it is just a couple of single list_stores packed
>> together. This approach works, but my question is if it is possible to do this more
simple?
>> I could not find a gtk_tree_store_append_column which would be nice. Is it possible to
>> make adding a column as easy as adding a row? Does anybody have a smart way to accomplish
>> this?
>The general idea is, you have a GtkListStore or a GtkTreeStore and put
>your data in there. Using that, you then use something like
>gtk_cell_renderer_text_new () with
>gtk_tree_view_insert_column_with_attributes () and set up which data you
>want to show in your columns.
I know how to add rows, but if I am not mistaken your approach is that you have a fixed
amount of columns. The question is how to add an extra column on an already defined
GtkListStore?
Say you have defined gtk_list_store_new(2, G_TYPE_DOUBLE,G_TYPE_DOUBLE); and you want to
add a third column to this. Where can you define that the 3th column should also be a
G_TYPE_DOUBLE? You can not define this with a gtk_tree_view_insert_column_with_attributes ().
Greetings, Edward
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]