]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/notebook.cpp
Applied patch for stipppled brushes,
[wxWidgets.git] / src / gtk1 / notebook.cpp
index 3bb33c9e2e44432fc69c6b065ce33bea7ee328a0..6cac1f91355ca2468e0ab0bfe18f23ee4e421403 100644 (file)
@@ -220,7 +220,13 @@ bool wxNotebook::Create(wxWindow *parent, wxWindowID id,
     m_acceptsFocus = TRUE;
     m_insertCallback = (wxInsertChildFunction)wxInsertChildInNotebook;
 
     m_acceptsFocus = TRUE;
     m_insertCallback = (wxInsertChildFunction)wxInsertChildInNotebook;
 
-    PreCreation( parent, id, pos, size, style, name );
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
+    {
+        wxFAIL_MSG( _T("wxNoteBook creation failed") );
+       return FALSE;
+    }
+
 
     m_widget = gtk_notebook_new();
 
 
     m_widget = gtk_notebook_new();
 
@@ -515,15 +521,15 @@ bool wxNotebook::InsertPage( int position, wxWindow* win, const wxString& text,
     page->m_box = gtk_hbox_new( FALSE, 0 );
     gtk_container_border_width( GTK_CONTAINER(page->m_box), 2 );
 
     page->m_box = gtk_hbox_new( FALSE, 0 );
     gtk_container_border_width( GTK_CONTAINER(page->m_box), 2 );
 
+    gtk_signal_connect( GTK_OBJECT(win->m_widget), "size_allocate",
+      GTK_SIGNAL_FUNC(gtk_page_size_callback), (gpointer)win );
+
     if (position < 0)
         gtk_notebook_append_page( notebook, win->m_widget, page->m_box );
     else 
         gtk_notebook_insert_page( notebook, win->m_widget, page->m_box, position );
 
     if (position < 0)
         gtk_notebook_append_page( notebook, win->m_widget, page->m_box );
     else 
         gtk_notebook_insert_page( notebook, win->m_widget, page->m_box, position );
 
-    page->m_page = GTK_NOTEBOOK_PAGE( g_list_last(notebook->children)->data );
-
-    gtk_signal_connect( GTK_OBJECT(win->m_widget), "size_allocate",
-      GTK_SIGNAL_FUNC(gtk_page_size_callback), (gpointer)win );
+    page->m_page = (GtkNotebookPage*) g_list_last(notebook->children)->data;
 
     /* set the label image */
     page->m_image = imageId;
 
     /* set the label image */
     page->m_image = imageId;