Beispiel #1
0
        public SwitchCell(
            string text,
            bool on)
        {
            _root = new HBox();
            Add(_root);

            _labelBox = new HBox(false, 0);
            _root.PackStart(_labelBox, true, true, 0);

            _textLabel = new Gtk.Label();
            _textLabel.SetAlignment(0, 0);
            _textLabel.Text = text ?? string.Empty;

            _labelBox.PackStart(_textLabel, false, true, 0);

            _checkButton = new CheckButton();
            _checkButton.SetAlignment(0, 0);
            _checkButton.Active   = on;
            _checkButton.Toggled += OnCheckButtonToggled;

            _root.PackStart(_checkButton, false, false, 0);
        }