From dfa98a3ea29ff77ff772822fe083ca7e5e17755e Mon Sep 17 00:00:00 2001 From: Ben Motmans Date: Tue, 17 Apr 2007 12:16:58 +0000 Subject: [PATCH] 2007-04-17 Ben Motmans * gtk/Widget.custom: StyleGetPropertyValue that returns a GLib.Value when StyleGetProperty cannot automatically cast the GLib.Value (eg: Gdk.Color) [Fixes #81253] * doc/en/Gtk/Widget.xml: Documentation for the new StyleGetPropertyValue method and improved documentation for StyleGetProperty * gtk/TreeView.custom: OddRowColor and EvenRowColor properties * doc/en/Gtk/TreeView.xml: documentation for OddRowColor and EvenRowColor properties svn path=/trunk/gtk-sharp/; revision=75816 --- ChangeLog | 12 ++++++++++++ doc/en/Gtk/TreeView.xml | 26 ++++++++++++++++++++++++++ doc/en/Gtk/Widget.xml | 21 ++++++++++++++++++++- gtk/TreeView.custom | 18 ++++++++++++++++++ gtk/Widget.custom | 9 +++++++++ 5 files changed, 85 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index d9cce0c4d..f8bb63f01 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2007-04-17 Ben Motmans + + * gtk/Widget.custom: + StyleGetPropertyValue that returns a GLib.Value when StyleGetProperty cannot automatically cast the GLib.Value (eg: Gdk.Color) + [Fixes #81253] + * doc/en/Gtk/Widget.xml: + Documentation for the new StyleGetPropertyValue method and improved documentation for StyleGetProperty + * gtk/TreeView.custom: + OddRowColor and EvenRowColor properties + * doc/en/Gtk/TreeView.xml: + documentation for OddRowColor and EvenRowColor properties + 2007-04-12 Brad Taylor * doc/en/Gtk/Widget.xml: Documentation for OnActivate, but only because diff --git a/doc/en/Gtk/TreeView.xml b/doc/en/Gtk/TreeView.xml index af04bf55c..090ce5a69 100644 --- a/doc/en/Gtk/TreeView.xml +++ b/doc/en/Gtk/TreeView.xml @@ -2269,5 +2269,31 @@ tree_view.AppendColumn ("title", text, "text", 0); + + + Property + + Gdk.Color + + + This property contains the background color that is used for all even rows. + a + + + + + + + Property + + Gdk.Color + + + This property contains the background color that is used for all odd rows. + a + The odd row color is only used when the property is set to true. + + + diff --git a/doc/en/Gtk/Widget.xml b/doc/en/Gtk/Widget.xml index 3ffdbf6dd..003c6d317 100644 --- a/doc/en/Gtk/Widget.xml +++ b/doc/en/Gtk/Widget.xml @@ -2950,10 +2950,29 @@ class TestClose Obtains the value of a style property of . The name of a style property. - To be added. + The property value. This can be one of the following types: , , , , , +, , , , +or . + + + Method + + GLib.Value + + + + + + Obtains the value of a style property of . + The name of a style property. + This method should only be used in certain scenarios where fails, for example: when the GLib.Value contains a . + A instance. When the instance is no longer needed, Dispose() must be invoked. + + + Property diff --git a/gtk/TreeView.custom b/gtk/TreeView.custom index ca998f368..ef6d92688 100644 --- a/gtk/TreeView.custom +++ b/gtk/TreeView.custom @@ -40,6 +40,24 @@ Raw = gtk_tree_view_new_with_model (store.Handle); } + public Gdk.Color OddRowColor { + get { + GLib.Value value = StyleGetPropertyValue ("odd-row-color"); + Gdk.Color ret = (Gdk.Color)value; + value.Dispose (); + return ret; + } + } + + public Gdk.Color EvenRowColor { + get { + GLib.Value value = StyleGetPropertyValue ("even-row-color"); + Gdk.Color ret = (Gdk.Color)value; + value.Dispose (); + return ret; + } + } + [DllImport("libgtk-win32-2.0-0.dll")] static extern IntPtr gtk_tree_view_get_columns (IntPtr raw); diff --git a/gtk/Widget.custom b/gtk/Widget.custom index 656339616..6eef23b68 100644 --- a/gtk/Widget.custom +++ b/gtk/Widget.custom @@ -331,6 +331,15 @@ public object StyleGetProperty (string property_name) { return ret; } +internal GLib.Value StyleGetPropertyValue (string property_name) { + GLib.Value value = new GLib.Value (); + + IntPtr name = GLib.Marshaller.StringToPtrGStrdup (property_name); + gtksharp_widget_style_get_property (Handle, name, ref value); + GLib.Marshaller.Free (name); + return value; +} + [DllImport("libgtk-win32-2.0-0.dll")] static extern IntPtr gtk_widget_list_mnemonic_labels (IntPtr raw);