Gtk's page event is intercepted before changing the page so GetSelected returned last page during EVT_NOTE.._CHANGED not the new one.
I added the variable int m_nSelection (as per generic/notebook.cpp) to hold the value of the current page. GetSelection is renamed to GetGtkSelection and is used to sync m_nSelection whenever there might be confusion, like deleting the current page. mnSelection is updated in the EVT..CHANGED handler by OnSelChanged (as per /generic/notebook.cpp) w/ event.GetSelection (which is a good value, from Gtk). It is updated for deleteing/removing/inserting... I hope I got them all.
-* Need more checks during GetSelection ???
Tests fine w/ samples controls & notebook.
diffs included for :
include/wx/gtk/notebook.cpp
src/gtk/notebook.cpp
Issue migrated from trac ticket # 4906
component: wxGTK | priority: normal
2001-02-02 02:32:11: anonymous created the issue
Gtk's page event is intercepted before changing the page so GetSelected returned last page during EVT_NOTE.._CHANGED not the new one. I added the variable int m_nSelection (as per generic/notebook.cpp) to hold the value of the current page. GetSelection is renamed to GetGtkSelection and is used to sync m_nSelection whenever there might be confusion, like deleting the current page. mnSelection is updated in the EVT..CHANGED handler by OnSelChanged (as per /generic/notebook.cpp) w/ event.GetSelection (which is a good value, from Gtk). It is updated for deleteing/removing/inserting... I hope I got them all.
-* Need more checks during GetSelection ???
Tests fine w/ samples controls & notebook.
diffs included for : include/wx/gtk/notebook.cpp src/gtk/notebook.cpp