X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9a7247f0e941c83cba9e620ca8541c60ec135a0b..ff0d9d83cd088b9f7c925db8262f86674a320724:/src/cocoa/notebook.mm diff --git a/src/cocoa/notebook.mm b/src/cocoa/notebook.mm index d79c9bd875..9cc3241b65 100644 --- a/src/cocoa/notebook.mm +++ b/src/cocoa/notebook.mm @@ -261,8 +261,23 @@ bool wxNotebook::SetPageImage(size_t nPage, int nImage) return true; } - int wxNotebook::SetSelection(size_t nPage) +{ + const int pageOld = GetSelection(); + + if ( !SendPageChangingEvent(nPage) ) + return pageOld; + + int page = ChangeSelection(nPage); + if ( page != wxNOT_FOUND ) + { + SendPageChangedEvent(pageOld); + } + + return page; +} + +int wxNotebook::ChangeSelection(size_t nPage) { wxAutoNSAutoreleasePool pool; [GetNSTabView() selectTabViewItemAtIndex:nPage];