diff options
author | Patrick McDermott <pj@pehjota.net> | 2017-10-24 03:45:00 (EDT) |
---|---|---|
committer | Patrick McDermott <pj@pehjota.net> | 2017-10-24 03:46:44 (EDT) |
commit | 17aa4945ac8cfda4e2349c627abc60ce6129dce8 (patch) | |
tree | ac4f5d29d0b76455c81385c1a0a28e214d7aa00f | |
parent | 5f489eaf07adde4e93d5cd903648af366bc01f05 (diff) | |
download | marquee-17aa4945ac8cfda4e2349c627abc60ce6129dce8.zip marquee-17aa4945ac8cfda4e2349c627abc60ce6129dce8.tar.gz marquee-17aa4945ac8cfda4e2349c627abc60ce6129dce8.tar.bz2 |
MqNotebook: Set current page on tab tree row activation
Now with no crashing!
-rw-r--r-- | src/notebook.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/notebook.c b/src/notebook.c index f7f06a0..b0854ee 100644 --- a/src/notebook.c +++ b/src/notebook.c @@ -172,14 +172,13 @@ tab_tree_row_activated_cb(GtkTreeView G_GNUC_UNUSED *tree_view, GtkTreeModel *tree_model; GtkTreeIter tree_iter; gint position; - gchar *title; tree_model = gtk_tree_view_get_model(tree_view); if (gtk_tree_model_get_iter(tree_model, &tree_iter, tree_path)) { - gtk_tree_model_get(tree_model, &tree_iter, - 0, &position, 1, &title, -1); - g_print ("Row %d, \"%s\" activated\n", position, title); - g_free(title); + gtk_tree_model_get(tree_model, &tree_iter, 0, &position, -1); + mq_notebook_set_current_page(notebook, position - 1); + } else { + g_assert_not_reached(); } gtk_widget_hide(notebook->tab_tree_popover); |