diff options
author | Patrick McDermott <pj@pehjota.net> | 2017-09-28 15:21:52 (EDT) |
---|---|---|
committer | Patrick McDermott <pj@pehjota.net> | 2017-09-28 15:21:52 (EDT) |
commit | e7531a9be760ef0d06dc8ee008cf8731278efc59 (patch) | |
tree | 688258abdef6831b964f791fa3f97fb78456f065 | |
parent | 503b605a9045a806d87de4614f29ef08bc60ba11 (diff) | |
download | marquee-e7531a9be760ef0d06dc8ee008cf8731278efc59.zip marquee-e7531a9be760ef0d06dc8ee008cf8731278efc59.tar.gz marquee-e7531a9be760ef0d06dc8ee008cf8731278efc59.tar.bz2 |
MqTab: Create model after tree and save tree selection
-rw-r--r-- | src/tab.c | 17 |
1 files changed, 10 insertions, 7 deletions
@@ -171,13 +171,16 @@ create_tree_model(MqTab *tab) static GtkWidget * create_tab_list(MqTab *tab) { - GtkWidget *tree_view; - GtkCellRenderer *cell_renderer; - GtkWidget *scrolled_window; - - tree_view = gtk_tree_view_new_with_model(create_tree_model(tab)); - gtk_tree_selection_set_mode(gtk_tree_view_get_selection( - GTK_TREE_VIEW(tree_view)), GTK_SELECTION_BROWSE); + GtkWidget *tree_view; + GtkTreeSelection *tree_selection; + GtkCellRenderer *cell_renderer; + GtkWidget *scrolled_window; + + tree_view = gtk_tree_view_new(); + tree_selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree_view)); + gtk_tree_selection_set_mode(tree_selection, GTK_SELECTION_BROWSE); + gtk_tree_view_set_model(GTK_TREE_VIEW(tree_view), + create_tree_model(tab)); gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(tree_view), FALSE); gtk_tree_view_set_activate_on_single_click(GTK_TREE_VIEW(tree_view), TRUE); |