Mercurial > repos > IBBoard.GtkSharp
changeset 13:245677d0d47e
Re #26: Add GTK wrapper methods
* Compact tabs in a notebook even more
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sat, 14 Aug 2010 19:37:49 +0000 |
parents | ffda5e5f1617 |
children | 0a466c011016 |
files | NotebookUtil.cs |
diffstat | 1 files changed, 6 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/NotebookUtil.cs Tue Aug 10 19:46:43 2010 +0000 +++ b/NotebookUtil.cs Sat Aug 14 19:37:49 2010 +0000 @@ -45,22 +45,23 @@ /// <returns> /// A <see cref="Widget"/> that can be used as a tab label that contains the label with the title text and a close button /// </returns> - public static Widget CreateNotebookTabLabelWithClose(Notebook notebook, Widget page,String title) + public static Widget CreateNotebookTabLabelWithClose(Notebook notebook, Widget page, String title) { HBox hbox = new HBox(); - hbox.PackStart(new Label(title)); + hbox.PackStart(new Label(title)); Button close = new Button(); - Gtk.Rc.ParseString ("style \"NotebookTab.CloseButton\" {\n GtkButton::inner-border = {0,0,0,0}\n }\n"); - Gtk.Rc.ParseString ("widget \"*.NotebookTab.CloseButton\" style \"NotebookTab.CloseButton\"\n"); + Gtk.Rc.ParseString("style \"NotebookTab.CloseButton\" {\n GtkWidget::focus-padding = 0\n GtkWidget::focus-line-width = 0\n xthickness = 0\n ythickness = 0\n GtkButton::inner-border = {0,0,0,0}\n }\n"); + Gtk.Rc.ParseString("widget \"*.NotebookTab.CloseButton\" style \"NotebookTab.CloseButton\"\n"); Image icon = Image.NewFromIconName("gtk-close", IconSize.Menu); icon.SetPadding(0, 0); close.Image = icon; close.Relief = ReliefStyle.None; close.FocusOnClick = false; close.BorderWidth = 0; - close.Name = "NotebookTab.CloseButton"; + close.Name = "NotebookTab.CloseButton"; close.Clicked += delegate { notebook.Remove(page); + page.Dispose(); }; hbox.PackStart(close); hbox.ShowAll();