changeset 345:599644ca9064

Use _get_logical_page() to get the logical page from the physical page.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Fri, 11 Apr 2003 12:26:54 +0000
parents 6a374f337d1f
children 81fae15885d7
files gtk/dw.c
diffstat 1 files changed, 20 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/gtk/dw.c	Fri Apr 11 12:22:10 2003 +0000
+++ b/gtk/dw.c	Fri Apr 11 12:26:54 2003 +0000
@@ -549,6 +549,25 @@
 	return retval;
 }
 
+/* Return the logical page id from the physical page id */
+int _get_logical_page(HWND handle, unsigned long pageid)
+{
+	int z;
+	GtkWidget **pagearray = gtk_object_get_data(GTK_OBJECT(handle), "pagearray");
+	GtkWidget *thispage = gtk_notebook_get_nth_page(GTK_NOTEBOOK(handle), pageid);
+  
+	if(pagearray && thispage)
+	{
+		for(z=0;z<256;z++)
+		{
+			if(thispage == pagearray[z])
+				return z;
+		}
+	}
+	return 256;
+}
+
+
 static gint _switch_page_event(GtkNotebook *notebook, GtkNotebookPage *page, guint page_num, gpointer data)
 {
 	SignalHandler *work = (SignalHandler *)data;
@@ -557,7 +576,7 @@
 	if(work)
 	{
 		int (*switchpagefunc)(HWND, int, void *) = work->func;
-		retval = switchpagefunc(work->window, page_num, work->data);
+		retval = switchpagefunc(work->window, _get_logical_page(GTK_WIDGET(notebook), page_num), work->data);
 	}
 	return retval;
 }
@@ -6309,24 +6328,6 @@
 	return 256;                                        
 }
 
-/* Return the logical page id from the physical page id */
-int _get_logical_page(HWND handle, unsigned long pageid)
-{
-	int z;
-	GtkWidget **pagearray = gtk_object_get_data(GTK_OBJECT(handle), "pagearray");
-	GtkWidget *thispage = gtk_notebook_get_nth_page(GTK_NOTEBOOK(handle), pageid);
-  
-	if(pagearray && thispage)
-	{
-		for(z=0;z<256;z++)
-		{
-			if(thispage == pagearray[z])
-				return z;
-		}
-	}
-	return 256;
-}
-
 /*
  * Remove a page from a notebook.
  * Parameters: