wxWidgets / wxWidgets

Cross-Platform C++ GUI Library
https://www.wxwidgets.org/
6.22k stars 1.78k forks source link

Notebook::GetSelected during EVT_NOTEBOOK_PAGE_CHANGED #4906

Closed wxtrac closed 2 years ago

wxtrac commented 23 years ago

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

wxtrac commented 23 years ago

2001-02-02 02:32:11: nobody uploaded file None (2.6 KiB)

None