# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1050064014 0 # Node ID 599644ca90640acdabf85103b17e3a16f5737b5a # Parent 6a374f337d1fa73b40003c3fea6afbd29e67f682 Use _get_logical_page() to get the logical page from the physical page. diff -r 6a374f337d1f -r 599644ca9064 gtk/dw.c --- 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: