* The handle of a TCustomForm contains in most cases a TCocoaWindowContent and not directly a NSWindow. This fixes an access violation

git-svn-id: trunk@43791 -
This commit is contained in:
joost 2014-01-25 10:50:10 +00:00
parent 4ba9ae2cdc
commit a491cb1360

View File

@ -382,8 +382,13 @@ begin
cnt.callback := TCocoaWindow(win).callback;
win.setContentView(cnt);
if AParams.WndParent <> 0 then
NSWindow(AParams.WndParent).addChildWindow_ordered(win, NSWindowAbove);
if (AParams.WndParent <> 0) then
begin
if (NSObject(AParams.WndParent).isKindOfClass(TCocoaWindowContent)) and (not TCocoaWindowContent(AParams.WndParent).isembedded) then
TCocoaWindowContent(AParams.WndParent).window.addChildWindow_ordered(win, NSWindowAbove)
else
NSWindow(AParams.WndParent).addChildWindow_ordered(win, NSWindowAbove);
end;
end
else
begin