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) { if (alignment.Child != null) { WidgetBackend.RemoveChildPlacement(alignment.Child); alignment.Remove(alignment.Child); } alignment.Child = WidgetBackend.GetWidgetWithPlacement(child); }
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 SetContent (IWidgetBackend widget) { childBackend = (WidgetBackend)widget; var newWidget = GetWidgetWithPlacement (widget); var oldWidget = Widget.Child; if (oldWidget == null) Widget.Child = newWidget; else { GtkEngine.ReplaceChild (oldWidget, newWidget); RemoveChildPlacement (oldWidget); } }
public void SetContent(IWidgetBackend widget) { childBackend = (WidgetBackend)widget; var newWidget = GetWidgetWithPlacement(widget); var oldWidget = Widget.Child; if (oldWidget == null) { Widget.Child = newWidget; } else { GtkEngine.ReplaceChild(oldWidget, newWidget); RemoveChildPlacement(oldWidget); } }
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 CustomTreeView(WidgetBackend b) { backend = b; }
public CustomTreeView(WidgetBackend b) { backend = b; base.DragBegin += (_, __) => delayedSelection = null; }
public virtual void UpdateChildPlacement(IWidgetBackend childBackend) { WidgetBackend.SetChildPlacement(childBackend); }
public void Add(IWidgetBackend widget) { WidgetBackend wb = (WidgetBackend)widget; Widget.Add(wb.Frontend, GetWidget(widget)); }