/*** GtkNotebook Page Switch Methods ***/
static void gtk_notebook_real_switch_page (GtkNotebook *notebook,
- GtkNotebookPage *page,
+ GtkNotebookPage *child,
guint page_num);
/*** GtkNotebook Page Switch Functions ***/
*/
static void
gtk_notebook_real_switch_page (GtkNotebook *notebook,
- GtkNotebookPage *page,
+ GtkNotebookPage* child,
guint page_num)
{
+ GList *list = gtk_notebook_find_child (notebook, GTK_WIDGET (child), NULL);
+ GtkNotebookPage *page = GTK_NOTEBOOK_PAGE (list);
gboolean child_has_focus;
- if (notebook->cur_page == page || !gtk_widget_get_visible (page->child))
+ if (notebook->cur_page == page || !gtk_widget_get_visible (GTK_WIDGET (child)))
return;
/* save the value here, changing visibility changes focus */
g_signal_emit (notebook,
notebook_signals[SWITCH_PAGE],
0,
- page,
+ page->child,
page_num);
}
typedef struct _GtkNotebook GtkNotebook;
typedef struct _GtkNotebookClass GtkNotebookClass;
+#if !defined (GTK_DISABLE_DEPRECATED) || defined (GTK_COMPILATION)
typedef struct _GtkNotebookPage GtkNotebookPage;
+#endif
struct _GtkNotebook
{
GtkContainer container;
+#if !defined (GTK_DISABLE_DEPRECATED) || defined (GTK_COMPILATION)
GtkNotebookPage *GSEAL (cur_page);
+#else
+ gpointer GSEAL (cur_page);
+#endif
GList *GSEAL (children);
GList *GSEAL (first_tab); /* The first tab visible (for scrolling notebooks) */
GList *GSEAL (focus_tab);
GtkContainerClass parent_class;
void (* switch_page) (GtkNotebook *notebook,
+#if !defined (GTK_DISABLE_DEPRECATED) || defined (GTK_COMPILATION)
GtkNotebookPage *page,
+#else
+ gpointer page,
+#endif
guint page_num);
/* Action signals for keybindings */
AtkObject parent;
GtkNotebook *notebook;
+#ifndef GTK_DISABLE_DEPRECATED
GtkNotebookPage *page;
+#else
+ gpointer page;
+#endif
gint index;
guint notify_child_added_id;
}
static void
-page_switch (GtkWidget *widget, GtkNotebookPage *page, gint page_num)
+page_switch (GtkWidget *widget, gpointer *page, gint page_num)
{
GtkNotebook *notebook = GTK_NOTEBOOK (widget);
gint old_page_num = gtk_notebook_get_current_page (notebook);