Re: A numbered column in a Gtk::TreeStore



Bryan Forbes wrote:

>	I'm working on audio support in Coaster and I have a Gtk::ListView to
>view a Gtk::TreeStore of tracks for an audio disc the user is creating.
>I need a column for the track number that automatically updates with the
>correct track number.
>
>  
>

See
http://developer.gnome.org/doc/API/2.0/gtk/GtkTreeViewColumn.html#gtk-tree-view-column-set-cell-data-func

In the callback you can call gtk_tree_model_get_path to get the path,
and then call gtk_tree_path_get_indices on the path to determine the
index of the row.
Then you can use that to set the text to be displayed by the column
renderer.



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