Example #1
0
        bool SetSizeAndPosition(int x, int y, int w, int h, Atk.CoordType coordType, bool setSize)
        {
            if (!widget.IsTopLevel)
            {
                return(false);
            }

            if (coordType == CoordType.Window)
            {
                int x_off, y_off;
                widget.GdkWindow.GetOrigin(out x_off, out y_off);
                x += x_off;
                y += y_off;

                if (x < 0 || y < 0)
                {
                    return(false);
                }
            }

            #pragma warning disable 0612
            widget.SetUposition(x, y);
            #pragma warning restore 0612

            if (setSize)
            {
                widget.SetSizeRequest(w, h);
            }

            return(true);
        }
Example #2
0
        public override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            if (!loaded)
            {
#if GTK2
                ContainerContentControl.SizeRequested += delegate(object o, Gtk.SizeRequestedArgs args)
                {
                    var alloc = args.Requisition;
                    if (MinimumSize.Width > 0)
                    {
                        alloc.Width = Math.Max(alloc.Width, MinimumSize.Width);
                    }
                    if (MinimumSize.Height > 0)
                    {
                        alloc.Height = Math.Max(alloc.Height, MinimumSize.Height);
                    }
                    args.Requisition = alloc;
                };
#else
                if (MinimumSize != Size.Empty)
                {
                    ContainerContentControl.SetSizeRequest(MinimumSize.Width, MinimumSize.Height);
                }
#endif
                loaded = true;
            }
        }
Example #3
0
 protected override void Initialize()
 {
     base.Initialize();
     SetContainerContent(alignment);
                 #if GTK2
     ContainerContentControl.SizeRequested += Connector.HandleContentSizeRequested;
                 #else
     if (MinimumSize != Size.Empty)
     {
         ContainerContentControl.SetSizeRequest(MinimumSize.Width, MinimumSize.Height);
     }
                 #endif
 }