diff options
author | Patrick McDermott <pj@pehjota.net> | 2017-10-18 03:34:09 (EDT) |
---|---|---|
committer | Patrick McDermott <pj@pehjota.net> | 2017-10-18 03:34:09 (EDT) |
commit | 61479a2347ba289d618602dfb14a0c1c76da614a (patch) | |
tree | 5eefe0bfac9d4b10a009e2284af403880010f3bf | |
parent | 5d3f14817a05b6bf4c062519dbb685e20b0aaeda (diff) | |
download | marquee-61479a2347ba289d618602dfb14a0c1c76da614a.zip marquee-61479a2347ba289d618602dfb14a0c1c76da614a.tar.gz marquee-61479a2347ba289d618602dfb14a0c1c76da614a.tar.bz2 |
MqTabPage: Add to tree before adding to notebook
gtk_notebook_insert_page() causes the "switch-page" signal to be
emitted, and MqWindow's callback looks for the newly inserted tab page
in the tree.
-rw-r--r-- | src/tab-page.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/src/tab-page.c b/src/tab-page.c index 27c6ae9..3ffdfe7 100644 --- a/src/tab-page.c +++ b/src/tab-page.c @@ -149,12 +149,7 @@ static void init_root(MqTabPage *tab_page) { tab_page->root = tab_page; - tab_page->parent = NULL; - tab_page->prev = NULL; - tab_page->next = NULL; - tab_page->first_child = tab_page->last_child = NULL; tab_page->position = 0; - tab_page->tree_size = 1; } static void @@ -163,13 +158,6 @@ init_non_root(MqTabPage *tab_page) GtkWidget *navigation_toolbar; GtkWidget *find_toolbar; - tab_page->parent = NULL; - tab_page->prev = NULL; - tab_page->next = NULL; - tab_page->first_child = tab_page->last_child = NULL; - tab_page->tree_size = 1; - tab_page->title = "New tab"; - tab_page->window = tab_page->source->window; tab_page->application = mq_window_get_application(tab_page->window); @@ -215,12 +203,12 @@ constructed(GObject *object) init_root(tab_page); break; case CREATE_SIBLING: - init_non_root(tab_page); append_sibling(tab_page); + init_non_root(tab_page); break; case CREATE_CHILD: - init_non_root(tab_page); append_child(tab_page); + init_non_root(tab_page); break; case CREATE_NONE: case N_CREATE_TYPES: @@ -326,8 +314,14 @@ mq_tab_page_class_init(MqTabPageClass *klass) } static void -mq_tab_page_init(MqTabPage G_GNUC_UNUSED *tab_page) +mq_tab_page_init(MqTabPage *tab_page) { + tab_page->parent = NULL; + tab_page->prev = NULL; + tab_page->next = NULL; + tab_page->first_child = tab_page->last_child = NULL; + tab_page->tree_size = 1; + tab_page->title = "New tab"; } MqTabPage * |