Use m_dummyNSView (if it exists) in place of m_cocoaNSView to retrieve the
superview's frame rectangle and this NSView's frame rectangle. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19774 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
0bcd741653
commit
576a15443d
@ -229,11 +229,12 @@ void wxWindow::DoGetSize(int *w, int *h) const
|
|||||||
|
|
||||||
void wxWindow::DoGetPosition(int *x, int *y) const
|
void wxWindow::DoGetPosition(int *x, int *y) const
|
||||||
{
|
{
|
||||||
NSView *superview = [m_cocoaNSView superview];
|
NSView *nsview = m_dummyNSView?m_dummyNSView:m_cocoaNSView;
|
||||||
|
NSView *superview = [nsview superview];
|
||||||
wxCHECK_RET(superview,"NSView does not have a superview");
|
wxCHECK_RET(superview,"NSView does not have a superview");
|
||||||
NSRect parentRect = [superview frame];
|
NSRect parentRect = [superview frame];
|
||||||
|
|
||||||
NSRect cocoaRect = [m_cocoaNSView frame];
|
NSRect cocoaRect = [nsview frame];
|
||||||
if(x)
|
if(x)
|
||||||
*x=(int)cocoaRect.origin.x;
|
*x=(int)cocoaRect.origin.x;
|
||||||
if(y)
|
if(y)
|
||||||
|
Loading…
Reference in New Issue
Block a user