Applied patch [ 597320 ] Return wxNotebook::SetSelection value
authorJulian Smart <julian@anthemion.co.uk>
Tue, 20 Aug 2002 08:34:05 +0000 (08:34 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Tue, 20 Aug 2002 08:34:05 +0000 (08:34 +0000)
commit90b18154c8a72d3f522d3960a70517d40bbf02e0
tree2305748abff4bfa50d2646e6ef1576f7096d8b06
parent2406fd34fed649dc5cf4acd4db1f0267c6051371
Applied patch [ 597320 ] Return wxNotebook::SetSelection value

By Hans Van Leemputten (hansvl)

According to the documentation
wxNotebook::SetSelection() should return the previous
selection... (Like wxMSW does) but the wxUniv version
returns the currently selected selection.

Patch was tested with wxX11.

Applied patch [ 597313 ] Popup menu still used after deletion

By Hans Van Leemputten (hansvl)

- This patch exists out of 2 parts;

Part 1 is a patch to show the problem with the menu
sample (this part is just to show the problem and should
not be put into CVS!).

Part 2 is the fix and should be put in CVS.
(src/univ/menu.cpp)

- Instructions to reproduce the problem with the menu
sample:
1. Apply part 1 of the patch only.
2. Run the sample after recompiling it.
3. Press "Close Test" -> "Close", this will basically
remove the current menu bar and recreate it again and
re-use the menu item "Close test" from the old menu
bar...
4. Again press "Close Test", doing this will already
crash the sample.

- The cause of the problem is that the m_popupMenu in
wxMenu is deleted because it is a child of the old menu
bar (Note: it does not get destroyed by the wxMenu
destructor, but by DestroyChildren()) and m_popupMenu
is not put back to NULL when this happens...

- This patch was tested only with wxX11.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16609 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
src/univ/menu.cpp
src/univ/notebook.cpp