summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/tab.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/tab.c b/src/tab.c
index 963b941..47daeba 100644
--- a/src/tab.c
+++ b/src/tab.c
@@ -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);