Example #1
0
		public DockNotebook ()
		{
			pagesCol = new ReadOnlyCollection<IDockNotebookTab> (pages);
			AddEvents ((Int32)(EventMask.AllEventsMask));

			tabStrip = new TabStrip (this);

			PackStart (tabStrip, false, false, 0);

			contentBox = new EventBox ();
			PackStart (contentBox, true, true, 0);

			ShowAll ();

			tabStrip.DropDownButton.Sensitive = false;

			tabStrip.DropDownButton.MenuCreator = delegate {
				Gtk.Menu menu = new Menu ();
				foreach (var tab in pages) {
					var mi = new Gtk.ImageMenuItem ("");
					menu.Insert (mi, -1);
					var label = (Gtk.AccelLabel) mi.Child;
					if (tab.Markup != null)
						label.Markup = tab.Markup;
					else
						label.Text = tab.Text;
					var locTab = tab;
					mi.Activated += delegate {
						CurrentTab = locTab;
					};
				}
				menu.ShowAll ();
				return menu;
			};
		}
        public DockNotebook()
        {
            pagesCol = new ReadOnlyCollection <IDockNotebookTab> (pages);
            AddEvents((Int32)(EventMask.AllEventsMask));

            tabStrip = new TabStrip(this);

            PackStart(tabStrip, false, false, 0);

            contentBox = new EventBox();
            PackStart(contentBox, true, true, 0);

            ShowAll();

            tabStrip.DropDownButton.Sensitive = false;

            tabStrip.DropDownButton.MenuCreator = delegate {
                Gtk.Menu menu = new Menu();
                foreach (var tab in pages)
                {
                    var mi = new Gtk.ImageMenuItem("");
                    menu.Insert(mi, -1);
                    var label = (Gtk.AccelLabel)mi.Child;
                    if (tab.Markup != null)
                    {
                        label.Markup = tab.Markup;
                    }
                    else
                    {
                        label.Text = tab.Text;
                    }
                    var locTab = tab;
                    mi.Activated += delegate {
                        CurrentTab = locTab;
                    };
                }
                menu.ShowAll();
                return(menu);
            };
        }
Example #3
0
		internal DockNotebookTab (DockNotebook notebook, TabStrip strip)
		{
			this.notebook = notebook;
			this.strip = strip;
		}
 internal DockNotebookTab(DockNotebook notebook, TabStrip strip)
 {
     this.notebook = notebook;
     this.strip    = strip;
 }