Skip to content
Snippets Groups Projects
Commit bd804db0 authored by Alexandre Savard's avatar Alexandre Savard
Browse files

[#3619] Fixed display appended imwidget at creation

parent e438d8e2
No related merge requests found
...@@ -71,6 +71,13 @@ static void ...@@ -71,6 +71,13 @@ static void
on_switch_page (GtkNotebook *notebook, GtkNotebookPage *page, guint page_num, gpointer userdata) on_switch_page (GtkNotebook *notebook, GtkNotebookPage *page, guint page_num, gpointer userdata)
{ {
guint index = gtk_notebook_get_current_page (GTK_NOTEBOOK (notebook)); guint index = gtk_notebook_get_current_page (GTK_NOTEBOOK (notebook));
GtkWidget *tab = gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), page_num);
// show the current widget
gtk_widget_grab_focus (tab);
gtk_widget_show_now (tab);
g_print ("switch to %i - current = %i\n", page_num, index); g_print ("switch to %i - current = %i\n", page_num, index);
} }
...@@ -186,14 +193,15 @@ im_window_add_tab (GtkWidget *widget) ...@@ -186,14 +193,15 @@ im_window_add_tab (GtkWidget *widget)
g_signal_connect (tab_CloseButton, "clicked", G_CALLBACK (close_tab_cb), widget); g_signal_connect (tab_CloseButton, "clicked", G_CALLBACK (close_tab_cb), widget);
/* Show it */ /* Show it */
gtk_widget_show_all (im_notebook);
gtk_widget_show_all (tab_Container); gtk_widget_show_all (tab_Container);
/* Add the page to the notebook */ /* Add the page to the notebook */
gtk_notebook_append_page (GTK_NOTEBOOK (im_notebook), widget, tab_Container); guint tabIndex = gtk_notebook_append_page (GTK_NOTEBOOK (im_notebook), widget, tab_Container);
/* TODO Switch to the newly opened tab. Still not working */ /* TODO Switch to the newly opened tab. Still not working */
guint tabIndex = gtk_notebook_page_num (GTK_NOTEBOOK (im_notebook), widget); DEBUG ("SWITCH TO NEW TAB: %i", tabIndex);
gtk_notebook_set_current_page (GTK_NOTEBOOK (im_notebook), tabIndex); gtk_notebook_set_current_page (GTK_NOTEBOOK (im_notebook), -1);
/* Decide whether or not displaying the tabs of the notebook */ /* Decide whether or not displaying the tabs of the notebook */
im_window_hide_show_tabs (); im_window_hide_show_tabs ();
...@@ -207,6 +215,7 @@ im_window_hide_show_tabs () ...@@ -207,6 +215,7 @@ im_window_hide_show_tabs ()
gtk_notebook_set_show_tabs (GTK_NOTEBOOK (im_notebook), FALSE); gtk_notebook_set_show_tabs (GTK_NOTEBOOK (im_notebook), FALSE);
} else } else
gtk_notebook_set_show_tabs (GTK_NOTEBOOK (im_notebook), TRUE); gtk_notebook_set_show_tabs (GTK_NOTEBOOK (im_notebook), TRUE);
} }
void void
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment