diff options
author | Camil Staps | 2019-12-12 14:59:47 +0100 |
---|---|---|
committer | Camil Staps | 2019-12-12 14:59:47 +0100 |
commit | fc5d54decf344a3104a6c46641b93ea2f7319a62 (patch) | |
tree | 852f1deb80f69b2be6686c350f3ca052867cc19b /src/Gtk/Widgets.icl | |
parent | Add G flag to ccall of gtk_sheet_moveto, to be sure (diff) |
Add GtkSortable for TreeView columns
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 |