From: Vadim Zeitlin Date: Fri, 4 Sep 1998 11:56:53 +0000 (+0000) Subject: image in the notebook is now at the left of the label (as in wxMSW), not at X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/741fd2033ebb76a2998b929c972ceaeefaeb5e57?ds=inline image in the notebook is now at the left of the label (as in wxMSW), not at its right git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@665 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/gtk/notebook.cpp b/src/gtk/notebook.cpp index e102ce8409..dd41046ec1 100644 --- a/src/gtk/notebook.cpp +++ b/src/gtk/notebook.cpp @@ -374,13 +374,6 @@ bool wxNotebook::AddPage(wxWindow* win, const wxString& text, wxCHECK_MSG(page != NULL, FALSE, "Can't add a page whose parent is not the notebook!"); - // then set the attributes - page->m_text = text; - if ( page->m_text.IsEmpty() ) - page->m_text = ""; - page->m_image = imageId; - gtk_label_set(page->m_label, page->m_text); - // create the image if any if ( imageId != -1 ) { wxASSERT( m_imageList != NULL ); @@ -394,6 +387,20 @@ bool wxNotebook::AddPage(wxWindow* win, const wxString& text, gtk_widget_show(pixmapwid); } + // then set the attributes + page->m_text = text; + if ( page->m_text.IsEmpty() ) + page->m_text = ""; + page->m_image = imageId; + page->m_label = (GtkLabel *)gtk_label_new(page->m_text); + gtk_box_pack_start(GTK_BOX(page->m_box), (GtkWidget *)page->m_label, + FALSE, FALSE, 3); + + // @@@: what does this do? do we still need it? + // gtk_misc_set_alignment(GTK_MISC(page->m_label), 0.0, 0.5); + + gtk_widget_show((GtkWidget *)page->m_label); + if ( bSelect ) { SetSelection(GetPageCount()); } @@ -421,15 +428,9 @@ void wxNotebook::AddChild( wxWindow *win ) page->m_box = gtk_hbox_new (FALSE, 0); gtk_container_border_width(GTK_CONTAINER(page->m_box), 2); - page->m_label = (GtkLabel *)gtk_label_new(""); - gtk_box_pack_start(GTK_BOX(page->m_box), (GtkWidget *)page->m_label, - FALSE, FALSE, 3); - gtk_widget_show((GtkWidget *)page->m_label); - page->m_client = win; gtk_notebook_append_page( GTK_NOTEBOOK(m_widget), win->m_widget, page->m_box ); - gtk_misc_set_alignment(GTK_MISC(page->m_label), 0.0, 0.5); page->m_page = (GtkNotebookPage*) (g_list_last(GTK_NOTEBOOK(m_widget)->children)->data); diff --git a/src/gtk1/notebook.cpp b/src/gtk1/notebook.cpp index e102ce8409..dd41046ec1 100644 --- a/src/gtk1/notebook.cpp +++ b/src/gtk1/notebook.cpp @@ -374,13 +374,6 @@ bool wxNotebook::AddPage(wxWindow* win, const wxString& text, wxCHECK_MSG(page != NULL, FALSE, "Can't add a page whose parent is not the notebook!"); - // then set the attributes - page->m_text = text; - if ( page->m_text.IsEmpty() ) - page->m_text = ""; - page->m_image = imageId; - gtk_label_set(page->m_label, page->m_text); - // create the image if any if ( imageId != -1 ) { wxASSERT( m_imageList != NULL ); @@ -394,6 +387,20 @@ bool wxNotebook::AddPage(wxWindow* win, const wxString& text, gtk_widget_show(pixmapwid); } + // then set the attributes + page->m_text = text; + if ( page->m_text.IsEmpty() ) + page->m_text = ""; + page->m_image = imageId; + page->m_label = (GtkLabel *)gtk_label_new(page->m_text); + gtk_box_pack_start(GTK_BOX(page->m_box), (GtkWidget *)page->m_label, + FALSE, FALSE, 3); + + // @@@: what does this do? do we still need it? + // gtk_misc_set_alignment(GTK_MISC(page->m_label), 0.0, 0.5); + + gtk_widget_show((GtkWidget *)page->m_label); + if ( bSelect ) { SetSelection(GetPageCount()); } @@ -421,15 +428,9 @@ void wxNotebook::AddChild( wxWindow *win ) page->m_box = gtk_hbox_new (FALSE, 0); gtk_container_border_width(GTK_CONTAINER(page->m_box), 2); - page->m_label = (GtkLabel *)gtk_label_new(""); - gtk_box_pack_start(GTK_BOX(page->m_box), (GtkWidget *)page->m_label, - FALSE, FALSE, 3); - gtk_widget_show((GtkWidget *)page->m_label); - page->m_client = win; gtk_notebook_append_page( GTK_NOTEBOOK(m_widget), win->m_widget, page->m_box ); - gtk_misc_set_alignment(GTK_MISC(page->m_label), 0.0, 0.5); page->m_page = (GtkNotebookPage*) (g_list_last(GTK_NOTEBOOK(m_widget)->children)->data);