Re: GtkTreeViewColumn - "set_title"
- Posted by irv Sep 27, 2010
- 926 views
In GtkRoutines.e is something called GtkTreeViewColumn and under it is "set_title". Is that the thing to use to change the title of a list? If so, how is it used?
In wxEuphoria it is done like this.
set_column_label(list, column, label)
How is it done in EuGTK?
atom col = get(tv,"column",1) -- where col 1 is the 2nd col, thanks to K&R's failure in kindergarten set(col,"title","FOO!")
Of course, you could always wrap this in a procedure or function if you want a one-liner. However, it's better to do it this way, because once you have the column, you can set more than one property if you wish. Here are some properties:
"alignment" gfloat : Read / Write "clickable" gboolean : Read / Write "expand" gboolean : Read / Write "fixed-width" gint : Read / Write "max-width" gint : Read / Write "min-width" gint : Read / Write "reorderable" gboolean : Read / Write "resizable" gboolean : Read / Write "sizing" GtkTreeViewColumnSizing : Read / Write "sort-column-id" gint : Read / Write "sort-indicator" gboolean : Read / Write "sort-order" GtkSortType : Read / Write "spacing" gint : Read / Write "title" gchar* : Read / Write "visible" gboolean : Read / Write "widget" GtkWidget* : Read / Write "width" gint : Read
Of these, "sort-order", "visible", and "width" are of interest, but the other one to look at is "widget". That means that you can insert a widget into the title (a button, an image, etc). "sort-indicator" also, it puts an up or down arrow to indicate the sort order - ascending or descending.