+ // This is a nasty hack because WebKit seems to lose its position when it is embedded
+ // in a control that is not itself the content view for a TLW.
+
+ wxWindow* parent = GetParent();
+ bool isParentTopLevel = true;
+ if (!parent->IsTopLevel())
+ isParentTopLevel = false;
+
+ int x = GetPosition().x;
+ // we must take into account the title bar size as well, which is 26 pixels
+ int y = GetPosition().y + 26;
+
+ NSRect bounds = [m_webView frame];
+ wxWindow* tlw = NULL;
+
+ while(parent != NULL)
+ {
+ if (parent->IsTopLevel())
+ tlw = parent;
+
+ x += parent->GetPosition().x;
+ y += parent->GetPosition().y;
+
+ if ( parent->IsKindOf( CLASSINFO( wxNotebook ) ) ){
+ //manually account for the size the tabs take up
+ y += 14;
+ }
+
+ //if ( parent->GetClassInfo()->GetClassName() == wxT("wxSplitterWindow") ){
+ // x += 3;
+ //}
+
+ parent = parent->GetParent();
+ }
+
+ if (!isParentTopLevel){
+ if (tlw){
+ //x = tlw->GetSize().x - (GetSize().x + x);
+ y = tlw->GetSize().y - (GetSize().y + y);
+ }
+ NSRect bounds = [m_webView frame];
+ bounds.origin.x += x;
+ bounds.origin.y += y;
+ //leaving debug checks in until I know it works everywhere ;-)
+ //printf("Added to bounds x=%d, y=%d\n", x, y);
+ [m_webView setFrame:bounds];
+ }
+
+ //printf("Carbon position x=%d, y=%d\n", GetPosition().x, GetPosition().y);
+ if (IsShown())
+ [m_webView display];