[Mac] Fix crash when checking if a widget has a native parent
This commit is contained in:
Родитель
dfafcea2a3
Коммит
f502ccf748
|
@ -124,6 +124,7 @@ namespace Xwt.Mac
|
||||||
RegisterBackend <Xwt.Backends.IPasswordEntryBackend, PasswordEntryBackend> ();
|
RegisterBackend <Xwt.Backends.IPasswordEntryBackend, PasswordEntryBackend> ();
|
||||||
RegisterBackend <Xwt.Backends.IWebViewBackend, WebViewBackend> ();
|
RegisterBackend <Xwt.Backends.IWebViewBackend, WebViewBackend> ();
|
||||||
RegisterBackend <Xwt.Backends.ISaveFileDialogBackend, SaveFileDialogBackend> ();
|
RegisterBackend <Xwt.Backends.ISaveFileDialogBackend, SaveFileDialogBackend> ();
|
||||||
|
RegisterBackend <Xwt.Backends.IColorPickerBackend, ColorPickerBackend> ();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void RunApplication ()
|
public override void RunApplication ()
|
||||||
|
@ -194,7 +195,10 @@ namespace Xwt.Mac
|
||||||
|
|
||||||
public override bool HasNativeParent (Widget w)
|
public override bool HasNativeParent (Widget w)
|
||||||
{
|
{
|
||||||
ViewBackend wb = (ViewBackend)Toolkit.GetBackend (w);
|
var b = (IWidgetBackend) Toolkit.GetBackend (w);
|
||||||
|
if (b is XwtWidgetBackend)
|
||||||
|
b = ((XwtWidgetBackend)b).NativeBackend;
|
||||||
|
ViewBackend wb = (ViewBackend)b;
|
||||||
return wb.Widget.Superview != null;
|
return wb.Widget.Superview != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -117,6 +117,10 @@ namespace Xwt.Backends
|
||||||
Font = new Xwt.Drawing.Font (value);
|
Font = new Xwt.Drawing.Font (value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IWidgetBackend NativeBackend {
|
||||||
|
get { return BackendHost.Backend; }
|
||||||
|
}
|
||||||
|
|
||||||
object IWidgetBackend.NativeWidget {
|
object IWidgetBackend.NativeWidget {
|
||||||
get { return BackendHost.Backend.NativeWidget; }
|
get { return BackendHost.Backend.NativeWidget; }
|
||||||
|
|
Загрузка…
Ссылка в новой задаче