public NotebookTabLabel(string title)
        {
            Button button = new Button ();
            button.Image = new Gtk.Image (Stock.Close, IconSize.Menu);
            button.TooltipText = "Close Tab";
            button.Relief = ReliefStyle.None;

            RcStyle rcStyle = new RcStyle ();
            rcStyle.Xthickness = 0;
            rcStyle.Ythickness = 0;
            button.ModifyStyle (rcStyle);

            button.FocusOnClick = false;
            button.Clicked += OnCloseClicked;
            button.Show ();

            Label label = new Label (title);
            label.UseMarkup = false;
            label.UseUnderline = false;
            label.Show ();

            HBox hbox = new HBox (false, 0);
            hbox.Spacing = 0;
            hbox.Add (label);
            hbox.Add (button);
            hbox.Show ();

            this.Add (hbox);
        }
		public TabLabel(string text, Notebook _nb) {
			Button btn = new Button();
			RcStyle rcStyle = new RcStyle ();
			rcStyle.Xthickness = 0;
			rcStyle.Ythickness = 0;
			btn.ModifyStyle (rcStyle);
			btn.Image = new Image(Stock.Close, IconSize.Menu);
			PackStart(TextLabel = new Label(text), true, true, 1);
			PackStart(btn, false, false, 0);
			CloseButton = btn;
			
			nb = _nb;
			//tabWidget = _tabWidget;
			
			CloseButton.Clicked += new EventHandler(OnCloseButtonClick);
			
			ShowAll();
		}
Exemple #3
0
        private void CreateUi(string name)
        {
            Caption = new Label(name + " ");
            Close   = new Button
            {
                Image       = new Image(Stock.Close, IconSize.Menu),
                TooltipText = "Close Tab",
                Relief      = ReliefStyle.None
            };

            var rcStyle = new RcStyle
            {
                Xthickness = 0,
                Ythickness = 0,
            };

            Close.ModifyStyle(rcStyle);
            PackStart(Caption);
            PackStart(Close);
            ShowAll();
            //Close.Hide();
        }