From 08f190790ea79298dd25b0361fe1a86c05437e3e Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Wed, 25 Oct 2017 10:35:41 -0400 Subject: mq_notebook_remove_page(): New function --- diff --git a/src/notebook.c b/src/notebook.c index 2aac350..0b53f1c 100644 --- a/src/notebook.c +++ b/src/notebook.c @@ -418,6 +418,18 @@ mq_notebook_insert_child(MqNotebook *notebook, const gchar *uri, return node->page; } +void +mq_notebook_remove_page(MqNotebook *notebook, MqTabPage *page) +{ + find_node(notebook, page); + + gtk_notebook_remove_page(GTK_NOTEBOOK(notebook), + mq_tree_position(notebook->found_node) - 1); + + mq_tree_remove_allocated(MQ_TREE(notebook->found_node)); + g_free(notebook->found_node); +} + gint mq_notebook_get_n_pages(MqNotebook *notebook) { diff --git a/src/notebook.h b/src/notebook.h index 30f00fb..605b1ed 100644 --- a/src/notebook.h +++ b/src/notebook.h @@ -65,6 +65,9 @@ MqTabPage * mq_notebook_insert_child(MqNotebook *notebook, const gchar *uri, MqTabPage *child, gboolean foreground); +void +mq_notebook_remove_page(MqNotebook *notebook, MqTabPage *page); + gint mq_notebook_get_n_pages(MqNotebook *notebook); -- cgit v0.9.1