+ wxAutoNSAutoreleasePool pool;
+ wxASSERT(GetNSControl());
+ /* We can ask single-celled controls for their cell and get its size */
+ NSCell *cell = nil;
+NS_DURING
+ cell = [GetNSControl() cell];
+NS_HANDLER
+ // TODO: if anything other than method not implemented, re-raise
+NS_ENDHANDLER
+ if(cell)
+ {
+ NSSize cellSize = [cell cellSize];
+ wxSize size((int)ceil(cellSize.width),(int)ceil(cellSize.height));
+ wxLogTrace(wxTRACE_COCOA_Window_Size,wxT("wxControl=%p::DoGetBestSize()==(%d,%d) from NSCell"),this,size.x,size.y);
+ return size;
+ }
+
+ /* multi-celled control? size to fit, get the size, then set it back */