public void SetChild(IWidgetBackend child) { if (child != null) { var w = GetWidget(child); WidgetBackend wb = (WidgetBackend)child; if (wb.EventSink.SupportsCustomScrolling()) { CustomViewPort vp = new CustomViewPort(wb.EventSink); vp.Show(); vp.Add(w); Widget.Child = vp; } else if (w is Gtk.Viewport) { Widget.Child = w; } else { Gtk.Viewport vp = new Gtk.Viewport(); vp.Show(); vp.Add(w); Widget.Child = vp; } } else { Widget.Child = null; } UpdateBorder(); }
public void SetChild(IWidgetBackend child) { RemoveChildPlacement(currentChild); if (Widget.Child != null) { if (Widget.Child is Gtk.Bin) { Gtk.Bin vp = (Gtk.Bin)Widget.Child; vp.Remove(vp.Child); } Widget.Remove(Widget.Child); } if (child != null) { var w = currentChild = GetWidgetWithPlacement(child); WidgetBackend wb = (WidgetBackend)child; if (wb.EventSink.SupportsCustomScrolling()) { CustomViewPort vp = new CustomViewPort(wb.EventSink); vp.Show(); vp.Add(w); Widget.Child = vp; } #if XWT_GTK3 else if (w is Gtk.IScrollable) { Widget.Child = w; } #else // Gtk2 has no interface for natively scrollable widgets, therefore we manually check // for types that should not be packed into a Viewport. // see: https://developer.gnome.org/gtk2/stable/GtkScrolledWindow.html#gtk-scrolled-window-add-with-viewport else if (w is Gtk.Viewport || w is Gtk.TreeView || w is Gtk.TextView || w is Gtk.Layout || w is WebKit.WebView) { Widget.Child = w; } #endif else { Gtk.Viewport vp = new Gtk.Viewport(); vp.Show(); vp.Add(w); Widget.Child = vp; } } UpdateBorder(); }
public void SetChild(IWidgetBackend child) { RemoveChildPlacement(currentChild); if (Widget.Child != null) { if (Widget.Child is Gtk.Bin) { Gtk.Bin vp = (Gtk.Bin)Widget.Child; vp.Remove(vp.Child); } Widget.Remove(Widget.Child); } if (child != null) { var w = currentChild = GetWidgetWithPlacement(child); WidgetBackend wb = (WidgetBackend)child; if (wb.EventSink.SupportsCustomScrolling()) { CustomViewPort vp = new CustomViewPort(wb.EventSink); vp.Show(); vp.Add(w); Widget.Child = vp; } else if (w is Gtk.Viewport) { Widget.Child = w; } else { Gtk.Viewport vp = new Gtk.Viewport(); vp.Show(); vp.Add(w); Widget.Child = vp; } } UpdateBorder(); }
public void SetChild (IWidgetBackend child) { RemoveChildPlacement (currentChild); if (Widget.Child != null) { if (Widget.Child is Gtk.Bin) { Gtk.Bin vp = (Gtk.Bin) Widget.Child; vp.Remove (vp.Child); } Widget.Remove (Widget.Child); } if (child != null) { var w = currentChild = GetWidgetWithPlacement (child); WidgetBackend wb = (WidgetBackend) child; if (wb.EventSink.SupportsCustomScrolling ()) { CustomViewPort vp = new CustomViewPort (wb.EventSink); vp.Show (); vp.Add (w); Widget.Child = vp; } else if (w is Gtk.Viewport) Widget.Child = w; else { Gtk.Viewport vp = new Gtk.Viewport (); vp.Show (); vp.Add (w); Widget.Child = vp; } } UpdateBorder (); }
public void SetChild(IWidgetBackend child) { if (child != null) { var w = GetWidget (child); WidgetBackend wb = (WidgetBackend) child; if (wb.EventSink.SupportsCustomScrolling ()) { CustomViewPort vp = new CustomViewPort (wb.EventSink); vp.Show (); vp.Add (w); Widget.Child = vp; } else if (w is Gtk.Viewport) Widget.Child = w; else { Gtk.Viewport vp = new Gtk.Viewport (); vp.Show (); vp.Add (w); Widget.Child = vp; } } else Widget.Child = null; UpdateBorder (); }
public void SetChild(IWidgetBackend child) { RemoveChildPlacement (currentChild); if (Widget.Child != null) { if (Widget.Child is Gtk.Bin) { Gtk.Bin vp = (Gtk.Bin) Widget.Child; vp.Remove (vp.Child); } Widget.Remove (Widget.Child); } if (child != null) { var w = currentChild = GetWidgetWithPlacement (child); WidgetBackend wb = (WidgetBackend) child; if (wb.EventSink.SupportsCustomScrolling ()) { CustomViewPort vp = new CustomViewPort (wb.EventSink); vp.Show (); vp.Add (w); Widget.Child = vp; } #if XWT_GTK3 else if (w is Gtk.IScrollable) Widget.Child = w; #else // Gtk2 has no interface for natively scrollable widgets, therefore we manually check // for types that should not be packed into a Viewport. // see: https://developer.gnome.org/gtk2/stable/GtkScrolledWindow.html#gtk-scrolled-window-add-with-viewport else if (w is Gtk.Viewport || w is Gtk.TreeView || w is Gtk.TextView || w is Gtk.Layout || w is WebKit.WebView) Widget.Child = w; #endif else { Gtk.Viewport vp = new Gtk.Viewport (); vp.Show (); vp.Add (w); Widget.Child = vp; } } UpdateBorder (); }