From 82a774cf98ac2dcca0ac9408f8a1d658014baf88 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 21 Jan 2014 18:39:03 +0000 Subject: [PATCH] Avoid selecting invalid tab when removing last page from wxOSX wxNotebook. Closes #15897. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75663 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/osx/cocoa/notebook.mm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/osx/cocoa/notebook.mm b/src/osx/cocoa/notebook.mm index d71ca4047c..2f8eceb426 100644 --- a/src/osx/cocoa/notebook.mm +++ b/src/osx/cocoa/notebook.mm @@ -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]; }