Exemplo n.º 1
0
        void Add(Widget widget, bool fill, int padding, int index)
        {
            int defaultPadding = 3;

            if (widget is Button)
            {
                ((Button)widget).Relief       = ReliefStyle.None;
                ((Button)widget).FocusOnClick = false;
                defaultPadding = 0;
            }
            else if (widget is Entry)
            {
                ((Entry)widget).HasFrame = false;
            }
            else if (widget is ComboBox)
            {
                ((ComboBox)widget).HasFrame = false;
            }
            else if (widget is VSeparator)
            {
                ((VSeparator)widget).HeightRequest = 10;
            }

            if (padding == -1)
            {
                padding = defaultPadding;
            }

            box.PackStart(widget, fill, fill, (uint)padding);
            if (empty)
            {
                empty = false;
                frame.Show();
            }
            if (index != -1)
            {
                Box.BoxChild bc = (Box.BoxChild)box [widget];
                bc.Position = index;
            }
        }