- int resultV = wxNOT_FOUND;
-#if TARGET_API_MAC_OSX
- const size_t countPages = GetPageCount();
-
- HIPoint hipoint= { pt.x , pt.y } ;
+ int resultV = wxNOT_FOUND;
+
+ const int countPages = GetPageCount();
+
+ // we have to convert from Client to Window relative coordinates
+ wxPoint adjustedPt = pt + GetClientAreaOrigin();
+ // and now to HIView native ones
+ adjustedPt.x -= MacGetLeftBorderSize() ;
+ adjustedPt.y -= MacGetTopBorderSize() ;
+
+ HIPoint hipoint= { adjustedPt.x , adjustedPt.y } ;