public Gtk.Table RemovePanel(string name) { Gtk.Notebook notebook2 = new Gtk.Notebook(); if (this.isRC) { notebook2 = this.rc.ChatTabs; } else { notebook2 = this.mw.ChatTabs; } foreach (object l in notebook2.AllChildren) { //Console.WriteLine("test: " + l.GetType()); if (l.GetType() == typeof(Gtk.Table)) { Gtk.Table test = (Gtk.Table)l; //this.WriteText("VPanedName: " + test.Name); if (test.Name == name) { notebook2.Remove(test); test.Dispose(); } } } return(null); }
public static void ReplaceChild(Gtk.Widget oldWidget, Gtk.Widget newWidget) { Gtk.Container cont = oldWidget.Parent as Gtk.Container; if (cont == null) { return; } if (cont is IGtkContainer) { ((IGtkContainer)cont).ReplaceChild(oldWidget, newWidget); } else if (cont is Gtk.Notebook) { Gtk.Notebook notebook = (Gtk.Notebook)cont; Gtk.Notebook.NotebookChild nc = (Gtk.Notebook.NotebookChild)notebook [oldWidget]; var detachable = nc.Detachable; var pos = nc.Position; var reorderable = nc.Reorderable; var tabExpand = nc.TabExpand; var tabFill = nc.TabFill; var label = notebook.GetTabLabel(oldWidget); notebook.Remove(oldWidget); notebook.InsertPage(newWidget, label, pos); nc = (Gtk.Notebook.NotebookChild)notebook [newWidget]; nc.Detachable = detachable; nc.Reorderable = reorderable; nc.TabExpand = tabExpand; nc.TabFill = tabFill; } else if (cont is Gtk.Paned) { var paned = (Gtk.Paned)cont; var pc = (Gtk.Paned.PanedChild)paned[oldWidget]; var resize = pc.Resize; var shrink = pc.Shrink; var pos = paned.Position; if (paned.Child1 == oldWidget) { paned.Remove(oldWidget); paned.Pack1(newWidget, resize, shrink); } else { paned.Remove(oldWidget); paned.Pack2(newWidget, resize, shrink); } paned.Position = pos; } else if (cont is Gtk.Bin) { ((Gtk.Bin)cont).Remove(oldWidget); ((Gtk.Bin)cont).Child = newWidget; } }
public void PreviousStage() { // We try to free memory. GC.Collect(); Gtk.Notebook parentNB = (Gtk.Notebook)(this.Parent); parentNB.PrevPage(); this.Abort(); parentNB.Remove(this); }
public static void ReplaceChild(Gtk.Widget oldWidget, Gtk.Widget newWidget) { Gtk.Container cont = oldWidget.Parent as Gtk.Container; if (cont == null) { return; } if (cont is IGtkContainer) { ((IGtkContainer)cont).ReplaceChild(oldWidget, newWidget); } else if (cont is Gtk.Notebook) { Gtk.Notebook notebook = (Gtk.Notebook)cont; Gtk.Notebook.NotebookChild nc = (Gtk.Notebook.NotebookChild)notebook[oldWidget]; var detachable = nc.Detachable; var pos = nc.Position; var reorderable = nc.Reorderable; var tabExpand = nc.TabExpand; var tabFill = nc.TabFill; var label = notebook.GetTabLabel(oldWidget); notebook.Remove(oldWidget); notebook.InsertPage(newWidget, label, pos); nc = (Gtk.Notebook.NotebookChild)notebook[newWidget]; nc.Detachable = detachable; nc.Reorderable = reorderable; nc.TabExpand = tabExpand; nc.TabFill = tabFill; } else if (cont is Gtk.Bin) { ((Gtk.Bin)cont).Remove(oldWidget); ((Gtk.Bin)cont).Child = newWidget; } }
protected void UpdateWidget() { if (!initialized) { return; } if (app is LocalApplication) { Gtk.Widget w = OnCreateWidget(); if (w.Parent != book) { book.AppendPage(w, null); w.Show(); } book.Page = book.NPages - 1; if (book.NPages > 1) { Gtk.Widget cw = book.GetNthPage(0); book.Remove(cw); OnDestroyWidget(cw); } } }
public Gtk.Table RemovePanel(string name) { Gtk.Notebook notebook2 = new Gtk.Notebook(); if (this.isRC) notebook2 = this.rc.ChatTabs; else notebook2 = this.mw.ChatTabs; foreach (object l in notebook2.AllChildren) { //Console.WriteLine("test: " + l.GetType()); if (l.GetType() == typeof(Gtk.Table)) { Gtk.Table test = (Gtk.Table)l; //this.WriteText("VPanedName: " + test.Name); if (test.Name == name) { notebook2.Remove(test); test.Dispose(); } } } return null; }
public void Remove(IWidgetBackend widget) { Widget.Remove(GetWidgetWithPlacement(widget)); }
public void Remove(IWidgetBackend widget) { Widget.Remove(GetWidget(widget)); }