From 2eb246518a2ff5cbc0696258668954c97d5ac863 Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Wed, 5 Jan 2005 21:59:06 +0000 Subject: [PATCH] 2005-01-05 Mike Kestner * gtk/TreeView.custom : add back the TreeCellDataFunc overloads for backward compat. * gtk/TreeViewColumn.custom : add back the TreeCellDataFunc overloads for backward compat. svn path=/trunk/gtk-sharp/; revision=38396 --- ChangeLog | 7 +++++++ doc/en/Gda/Time.xml | 15 +-------------- doc/en/Gtk/TreeView.xml | 20 ++++++++++++++++++++ doc/en/Gtk/TreeViewColumn.xml | 19 ++++++++++++++++++- gtk/TreeView.custom | 11 +++++++++++ gtk/TreeViewColumn.custom | 14 ++++++++++++++ 6 files changed, 71 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index fcb025ee9..d4140a157 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-01-05 Mike Kestner + + * gtk/TreeView.custom : add back the TreeCellDataFunc overloads for + backward compat. + * gtk/TreeViewColumn.custom : add back the TreeCellDataFunc overloads for + backward compat. + 2005-01-05 Mike Kestner * generator/Field.cs : deal with LPGen/LPUGen fields. diff --git a/doc/en/Gda/Time.xml b/doc/en/Gda/Time.xml index c15fd1851..cfb000c0e 100644 --- a/doc/en/Gda/Time.xml +++ b/doc/en/Gda/Time.xml @@ -87,19 +87,6 @@ To be added - - - Field - - System.Int64 - - - - - To be added - To be added - - Property @@ -114,4 +101,4 @@ - \ No newline at end of file + diff --git a/doc/en/Gtk/TreeView.xml b/doc/en/Gtk/TreeView.xml index e684baa24..b64960b68 100644 --- a/doc/en/Gtk/TreeView.xml +++ b/doc/en/Gtk/TreeView.xml @@ -1820,5 +1820,25 @@ tree_view.AppendColumn ("title", text, "text", 0); + + + Method + + Gtk.TreeViewColumn + + + + + + + + Adds a new to the TreeView and returns it. + a + a + a + a + This method actually creates the column, rather than relying on a column object to be passed in. There's an alternate invokation form if you'd like to pass in an existing column object. + + diff --git a/doc/en/Gtk/TreeViewColumn.xml b/doc/en/Gtk/TreeViewColumn.xml index 7f37e6475..0efaec44e 100644 --- a/doc/en/Gtk/TreeViewColumn.xml +++ b/doc/en/Gtk/TreeViewColumn.xml @@ -712,7 +712,24 @@ Sets the attribute to model column bindings for a renderer. a a - The array should consist of pairs of attribute name and column index. + The array should consist of pairs of attribute name and column index. + + + + + Method + + System.Void + + + + + + + Sets the to use for a renderer. + a + a + This function is used instead of the standard attributes mapping for setting the column value, and should set the value of the as appropriate. may be to remove an older one. diff --git a/gtk/TreeView.custom b/gtk/TreeView.custom index 377b59eb6..628a501c3 100644 --- a/gtk/TreeView.custom +++ b/gtk/TreeView.custom @@ -120,6 +120,17 @@ return raw_ret; } + public TreeViewColumn AppendColumn (string title, CellRenderer cell, TreeCellDataFunc cell_data) + { + Gtk.TreeViewColumn col = new Gtk.TreeViewColumn (); + col.Title = title; + col.PackStart (cell, true); + col.SetCellDataFunc (cell, cell_data); + + AppendColumn (col); + return col; + } + public TreeViewColumn AppendColumn (string title, CellRenderer cell, CellLayoutDataFunc cell_data) { Gtk.TreeViewColumn col = new Gtk.TreeViewColumn (); col.Title = title; diff --git a/gtk/TreeViewColumn.custom b/gtk/TreeViewColumn.custom index 9369b4e35..6b71830e7 100644 --- a/gtk/TreeViewColumn.custom +++ b/gtk/TreeViewColumn.custom @@ -85,9 +85,23 @@ gtk_tree_view_column_set_cell_data_func(Handle, cell.Handle, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero); } + [DllImport("libgtk-win32-2.0-0.dll")] + static extern void gtk_tree_view_column_set_cell_data_func(IntPtr raw, IntPtr cell_renderer, GtkSharp.TreeCellDataFuncNative func, IntPtr func_data, IntPtr destroy); + [DllImport("libgtk-win32-2.0-0.dll")] static extern void gtk_tree_view_column_set_cell_data_func(IntPtr raw, IntPtr cell_renderer, GtkSharp.CellLayoutDataFuncNative func, IntPtr func_data, IntPtr destroy); + public void SetCellDataFunc (CellRenderer cell_renderer, TreeCellDataFunc func) + { + if (func == null) { + ReleaseDataFunc (cell_renderer); + return; + } +; + GtkSharp.TreeCellDataFuncWrapper wrapper = new GtkSharp.TreeCellDataFuncWrapper (func, this); + CellDataFuncs [cell_renderer.Handle] = wrapper; + gtk_tree_view_column_set_cell_data_func(Handle, cell_renderer.Handle, wrapper.NativeDelegate, IntPtr.Zero, IntPtr.Zero); + } public void SetCellDataFunc (CellRenderer cell_renderer, CellLayoutDataFunc func) { if (func == null) {