# HG changeset patch # User IBBoard # Date 1248296299 0 # Node ID 49307b998555ac114840f3d91bf91c470853ee38 # Parent 51b4bbca7c19f703843545d6477bbf7250fbdce3 Re #23: Add easy creation of "tab with close" * Fix spacing to make tab smaller (ugly hack that involves making GTK parse gtkrc properties) diff -r 51b4bbca7c19 -r 49307b998555 NotebookUtil.cs --- a/NotebookUtil.cs Thu Jun 25 20:04:21 2009 +0000 +++ b/NotebookUtil.cs Wed Jul 22 20:58:19 2009 +0000 @@ -30,9 +30,15 @@ HBox hbox = new HBox(); hbox.PackStart(new Label(title)); Button close = new Button(); - close.Image = Image.NewFromIconName("gtk-close", IconSize.Menu); + 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"); + 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.Clicked += delegate { hbox.Destroy(); page.Destroy();