diff options
Diffstat (limited to 'src/Gtk/Widgets.icl')
-rw-r--r-- | src/Gtk/Widgets.icl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Gtk/Widgets.icl b/src/Gtk/Widgets.icl index 4fec8d4..d4f53a4 100644 --- a/src/Gtk/Widgets.icl +++ b/src/Gtk/Widgets.icl @@ -540,13 +540,14 @@ newTreeView (GtkListStore s) = toState (g_object_unref s) >>| show (GtkTreeView view) -appendColumnToTreeView :: !String !Int !GtkExpand !GtkTreeView -> GtkM GtkTreeView -appendColumnToTreeView title col expand tree=:(GtkTreeView tv) = +appendColumnToTreeView :: !String !Int !GtkSortable !GtkExpand !GtkTreeView -> GtkM GtkTreeView +appendColumnToTreeView title col sortable expand tree=:(GtkTreeView tv) = toStateR gtk_cell_renderer_text_new >>= \renderer -> toStateR gtk_tree_view_column_new >>= \column -> toState (gtk_tree_view_column_set_title column title) >>| toState (gtk_tree_view_column_pack_start column renderer expand=:Expand) >>| toState (gtk_tree_view_column_add_attribute column renderer "text" col) >>| + if (sortable=:Sortable) (toState (gtk_tree_view_column_set_sort_column_id column col)) (pure ()) >>| toState (gtk_tree_view_append_column tv column) >>| pure tree |