static void NativeDestroy(object o, EventArgs args) { Gtk.Widget widget = o as Gtk.Widget; if (widget == null) { return; } widget.OnDestroyed(); }