]> git.saurik.com Git - wxWidgets.git/blobdiff - src/cocoa/notebook.mm
regen bakefiles - get rid of explicit size setting after ctor
[wxWidgets.git] / src / cocoa / notebook.mm
index 3518e49a500278da28787a45d897eb26a4b83e2b..12863c1b90ed177376c7ff93bef83400ed8f28b2 100644 (file)
@@ -6,14 +6,17 @@
 // Created:     2004/04/08
 // RCS-ID:      $Id$
 // Copyright:   (c) 2004 David Elliott
-// Licence:    wxWindows licence
+// Licence:    wxWidgets licence
 /////////////////////////////////////////////////////////////////////////////
 
 #include "wx/wxprec.h"
+
+#if wxUSE_NOTEBOOK
+
 #ifndef WX_PRECOMP
     #include "wx/app.h"
-    #include "wx/notebook.h"
 #endif //WX_PRECOMP
+#include "wx/notebook.h"
 #include "wx/imaglist.h"
 
 #include "wx/cocoa/autorelease.h"
@@ -177,7 +180,7 @@ wxNotebookPage *wxNotebook::DoRemovePage(size_t nPage)
     [tvitem retain];
     [GetNSTabView() removeTabViewItem:tvitem];
     // Remove the child window as a notebook page
-    wxASSERT([tvitem view] == page->GetNSViewForSuperview());
+    wxASSERT(static_cast<NSView*>([tvitem view]) == page->GetNSViewForSuperview());
     [tvitem setView:nil];
     [tvitem release];
     // Make it back into a normal child window
@@ -260,6 +263,7 @@ bool wxNotebook::SetPageImage(size_t nPage, int nImage)
 
 int wxNotebook::SetSelection(size_t nPage)
 {
+    wxAutoNSAutoreleasePool pool;
     [GetNSTabView() selectTabViewItemAtIndex:nPage];
     return GetSelection();
 }
@@ -288,3 +292,4 @@ bool wxNotebook::CocoaDelegate_tabView_shouldSelectTabViewItem(WX_NSTabViewItem
     return !GetEventHandler()->ProcessEvent(event) || event.IsAllowed();
 }
 
+#endif // wxUSE_NOTEBOOK