Exemplo n.º 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;
			};
		}
Exemplo n.º 2
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);
            };
        }
Exemplo n.º 3
0
		internal DockNotebookTab (DockNotebook notebook, TabStrip strip)
		{
			this.notebook = notebook;
			this.strip = strip;
		}
Exemplo n.º 4
0
 internal DockNotebookTab(DockNotebook notebook, TabStrip strip)
 {
     this.notebook = notebook;
     this.strip    = strip;
 }