+    wxCHECK_MSG( page < (int)m_pagesData.GetCount(), NULL, wxT("invalid notebook index") );
+
+    return m_pagesData.Item(page)->GetData();
+}
+
+int wxNotebook::DoSetSelection( size_t page, int flags )
+{
+    wxCHECK_MSG( m_widget != NULL, wxNOT_FOUND, wxT("invalid notebook") );
+
+    wxCHECK_MSG( page < m_pagesData.GetCount(), -1, wxT("invalid notebook index") );
+
+    int selOld = GetSelection();
+
+    if ( !(flags & SetSelection_SendEvent) )
+        m_skipNextPageChangeEvent = true;
+
+    // cache the selection
+    m_selection = page;
+    gtk_notebook_set_page( GTK_NOTEBOOK(m_widget), page );
+
+    // gtk_notebook_set_current_page is supposed to emit the switch-page signal
+    // which should be caught by our gtk_notebook_page_change_callback which
+    // should have reset the flag to false, check it:
+    wxASSERT_LEVEL_2_MSG(
+        (flags & SetSelection_SendEvent) || !m_skipNextPageChangeEvent,
+        "internal error in selection events generation"
+    );
+
+    wxNotebookPage *client = GetPage(page);
+    if ( client )
+        client->SetFocus();
+
+    return selOld;
+}
+
+bool wxNotebook::SetPageText( size_t page, const wxString &text )
+{
+    wxCHECK_MSG( m_widget != NULL, FALSE, wxT("invalid notebook") );
+
+    wxGtkNotebookPage* nb_page = GetNotebookPage(page);
+
+    wxCHECK_MSG( nb_page, FALSE, wxT("SetPageText: invalid page index") );
+
+    nb_page->m_text = text;
+
+    gtk_label_set( nb_page->m_label, wxGTK_CONV( nb_page->m_text ) );
+
+    return true;
+}
+
+bool wxNotebook::SetPageImage( size_t page, int image )
+{
+    /* HvdH 28-12-98: now it works, but it's a bit of a kludge */
+
+    wxGtkNotebookPage* nb_page = GetNotebookPage(page);
+
+    if (!nb_page) return FALSE;
+
+    /* Optimization posibility: return immediately if image unchanged.
+     * Not enabled because it may break existing (stupid) code that
+     * manipulates the imagelist to cycle images */
+
+    /* if (image == nb_page->m_image) return true; */
+
+    /* For different cases:
+       1) no image -> no image
+       2) image -> no image
+       3) no image -> image
+       4) image -> image */
+
+    if (image == -1 && nb_page->m_image == -1)
+        return true; /* Case 1): Nothing to do. */
+
+    GtkWidget *pixmapwid = NULL;
+
+    if (nb_page->m_image != -1)
+    {
+        /* Case 2) or 4). There is already an image in the gtkhbox. Let's find it */
+
+        GList *child = gtk_container_children(GTK_CONTAINER(nb_page->m_box));
+        while (child)
+        {
+            if (GTK_IS_PIXMAP(child->data))
+            {
+                pixmapwid = GTK_WIDGET(child->data);
+                break;
+            }
+            child = child->next;
+        }
+
+        /* We should have the pixmap widget now */
+        wxASSERT(pixmapwid != NULL);
+
+        if (image == -1)
+        {
+            /* If there's no new widget, just remove the old from the box */
+            gtk_container_remove(GTK_CONTAINER(nb_page->m_box), pixmapwid);
+            nb_page->m_image = -1;
+
+            return true; /* Case 2) */
+        }
+    }
+
+    /* Only cases 3) and 4) left */
+    wxASSERT( HasImageList() ); /* Just in case */
+
+    /* Construct the new pixmap */
+    const wxBitmap *bmp = GetImageList()->GetBitmapPtr(image);
+    GdkPixmap *pixmap = bmp->GetPixmap();
+    GdkBitmap *mask = NULL;
+    if ( bmp->GetMask() )
+    {
+        mask = bmp->GetMask()->GetBitmap();
+    }
+
+    if (pixmapwid == NULL)
+    {
+        /* Case 3) No old pixmap. Create a new one and prepend it to the hbox */
+        pixmapwid = gtk_pixmap_new (pixmap, mask );
+
+        /* CHECKME: Are these pack flags okay? */
+        gtk_box_pack_start(GTK_BOX(nb_page->m_box), pixmapwid, FALSE, FALSE, m_padding);
+        gtk_widget_show(pixmapwid);
+    }
+    else
+    {
+        /* Case 4) Simply replace the pixmap */
+        gtk_pixmap_set(GTK_PIXMAP(pixmapwid), pixmap, mask);
+    }
+
+    nb_page->m_image = image;
+
+    return true;
+}