X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/49bf4e3e689c2131994aa2aab3c9eca6255a46eb..e8a8d0dc2ddfae4aa8d5fd832f7644a32773aac9:/src/cocoa/notebook.mm diff --git a/src/cocoa/notebook.mm b/src/cocoa/notebook.mm index 33687e9f0b..9cc3241b65 100644 --- a/src/cocoa/notebook.mm +++ b/src/cocoa/notebook.mm @@ -64,6 +64,7 @@ - (void)dealloc { [m_image release]; + [super dealloc]; } - (NSSize)sizeOfLabel:(BOOL)shouldTruncateLabel @@ -260,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];