helper Visual { public class VisualCI : Native.ContructInfo { public int pgadParent; }; public Visual(Visual vParent) { VisualCI ci = new VisualCI(); ci.pgadParent = vParent.pgad; int pgad = Native.BuildGadget(idVisual, ci); if (pgad != 0) { this.pgad = pgad; } else { uint error = Native.GetLastError(); throw new System.SystemException("Unable to create new Visual"); } } public Visual(HGadget gadParent) { VisualCI ci = new VisualCI(); ci.pgadParent = Native.CastGadgetDirect(gadParent.hgad); int pgad = Native.BuildGadget(Native.FindGadgetClass("Visual", 1), ci); if (pgad != 0) { this.pgad = pgad; } else { uint error = Native.GetLastError(); throw new System.SystemException("Unable to create new Visual"); } } };