+ wxTopLevelWindowMac* rootwindow = window->MacGetTopLevelWindow() ;
+ if (!rootwindow)
+ return;
+
+ WindowRef windowref = (WindowRef) rootwindow->MacGetWindowRef() ;
+ wxPoint origin = window->GetClientAreaOrigin() ;
+ wxSize size = window->GetClientSize() ;
+ int x , y ;
+ x = origin.x ;
+ y = origin.y ;
+ window->MacWindowToRootWindow( &x , &y ) ;
+ m_macPort = UMAGetWindowPort( windowref ) ;
+ m_ok = true ;
+