Avoid selecting invalid tab when removing last page from wxOSX wxNotebook.

Closes #15897 (backport of r75663 from trunk).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76319 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-04-12 22:54:26 +00:00
parent ef0f7ba770
commit 49a19edf63

View File

@@ -194,7 +194,8 @@ public:
// avoid 'changed' events when setting the tab programmatically
wxTabViewController* controller = [slf delegate];
[slf setDelegate:nil];
[slf selectTabViewItemAtIndex:(value-1)];
if ( value > 0 )
[slf selectTabViewItemAtIndex:(value-1)];
[slf setDelegate:controller];
}