예제 #1
0
		ToggleToolButton AddButton (string label)
		{
			ToggleToolButton newButton = new ToggleToolButton ();
			isUpdating = true;
			try {
				newButton.Label = label;
				newButton.IsImportant = true;
				newButton.Clicked += new EventHandler (OnButtonToggled);
				newButton.ShowAll ();
				this.toolbarPages.Insert (newButton, -1);
			} finally {
				isUpdating = false;
			}
			return newButton;
		}
		protected ToggleToolButton AddButton (string label, Gtk.Widget page)
		{
			updating = true;
			ToggleToolButton button = new ToggleToolButton ();
			button.Label = label;
			button.IsImportant = true;
			button.Clicked += new EventHandler (OnButtonToggled);
			button.ShowAll ();
			toolbar.Insert (button, -1);
			notebook.AppendPage (page, new Gtk.Label ());
			updating = false;
			return button;
		}
예제 #3
0
		protected ToggleToolButton AddButton (string label, Gtk.Widget page)
		{
			CheckCreateSubViewToolbar ();
			updating = true;
			ToggleToolButton button = new ToggleToolButton ();
			button.Label = label;
			button.IsImportant = true;
			button.Clicked += new EventHandler (OnButtonToggled);
			button.ShowAll ();
			subViewToolbar.Insert (button, -1);
			subViewNotebook.AppendPage (page, new Gtk.Label ());
			page.ShowAll ();
			EnsureToolbarBoxSeparator ();
			updating = false;
			return button;
		}
		void UpdateButtons ()
		{
			updating = true;
			
			foreach (Gtk.Widget c in Children)
				Remove (c);
			foreach (Gtk.Widget page in notebook.Children) {
				Gtk.Widget t = notebook.GetTabLabel (page);
				notebook.SetTabLabel (page, new Gtk.Label (""));
//				Gtk.Widget nw;
//				if (t is Gtk.Label)
//					nw = new Gtk.Label (((Gtk.Label)t).Text);
//				else
//					nw = new Gtk.Label ("");
				ToggleToolButton button = new ToggleToolButton ();
				button.IsImportant = true;
				button.LabelWidget = t;
				button.Clicked += new EventHandler (OnButtonToggled);
				button.ShowAll ();
				Insert (button, -1);
			}
			updating = false;
		}