diff options
author | Patrick McDermott <pj@pehjota.net> | 2017-10-25 10:35:41 (EDT) |
---|---|---|
committer | Patrick McDermott <pj@pehjota.net> | 2017-10-25 10:35:41 (EDT) |
commit | 08f190790ea79298dd25b0361fe1a86c05437e3e (patch) | |
tree | ab28c240e7fcb61fbbd1788dda04b4192c0be11f | |
parent | 5f1541db4c3d4fd4d571d0010947c3c13caff3db (diff) | |
download | marquee-08f190790ea79298dd25b0361fe1a86c05437e3e.zip marquee-08f190790ea79298dd25b0361fe1a86c05437e3e.tar.gz marquee-08f190790ea79298dd25b0361fe1a86c05437e3e.tar.bz2 |
mq_notebook_remove_page(): New function
-rw-r--r-- | src/notebook.c | 12 | ||||
-rw-r--r-- | src/notebook.h | 3 |
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); |