summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/notebook.c12
-rw-r--r--src/notebook.h3
2 files changed, 15 insertions, 0 deletions
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);