public void Add(Control child, int x, int y) { var ctl = child.GetGtkControlHandler(); #if GTK3 var widget = ctl.ContainerControl; if (widget.Parent != null) { ((Gtk.Container)widget.Parent).Remove(widget); } widget.ShowAll(); widget = new EtoVBox { Child = widget }; #else var widget = ctl.ContainerControl; if (widget.Parent != null) { ((Gtk.Container)widget.Parent).Remove(widget); } widget.ShowAll(); #endif Control.Put(widget, x, y); ctl.CurrentLocation = new Point(x, y); InvalidateMeasure(); }
public FormHandler() { Control = new Gtk.Window(Gtk.WindowType.Toplevel); #if GTK2 Control.AllowGrow = true; #endif Resizable = true; Control.SetPosition(Gtk.WindowPosition.Center); var vbox = new EtoVBox { Handler = this }; vbox.PackStart(WindowActionControl, false, true, 0); vbox.PackStart(WindowContentControl, true, true, 0); Control.Child = vbox; }
protected override void Initialize() { base.Initialize(); Control.KeyPressEvent += Connector.Control_KeyPressEvent; var vbox = new EtoVBox { Handler = this }; vbox.PackStart(WindowActionControl, false, true, 0); vbox.PackStart(WindowContentControl, true, true, 0); #pragma warning disable 612 actionarea = Control.ActionArea; #pragma warning restore 612 #if GTK2 var content = Control.VBox; btcontainer = Control.ActionArea; #else var content = Control.ContentArea; actionarea.NoShowAll = true; actionarea.Hide(); #if GTKCORE if (Helper.UseHeaderBar) { btcontainer = new Gtk.HeaderBar(); var title = Control.Title; Control.Titlebar = btcontainer; Control.Title = title; } else #endif btcontainer = actionarea; #endif content.PackStart(vbox, true, true, 0); }