static void OpenWindow(ProjectItemInfo item) { Gtk.Widget page = (Gtk.Widget)openWindows [item]; if (page != null) { page.Show(); WidgetNotebook.Page = WidgetNotebook.PageNum(page); } else { DesignerView view = new DesignerView(Project, item); // Tab label HBox tabLabel = new HBox(); tabLabel.PackStart(new Gtk.Image(item.Component.Type.Icon), true, true, 0); tabLabel.PackStart(new Label(item.Name), true, true, 3); Button b = new Button(new Gtk.Image("gtk-close", IconSize.Menu)); b.Relief = Gtk.ReliefStyle.None; b.WidthRequest = b.HeightRequest = 24; b.Clicked += delegate(object s, EventArgs a) { view.Hide(); WidgetNotebook.QueueResize(); }; tabLabel.PackStart(b, false, false, 0); tabLabel.ShowAll(); // Notebook page int p = WidgetNotebook.AppendPage(view, tabLabel); view.ShowAll(); openWindows [item] = view; WidgetNotebook.Page = p; } }