From 31b0cf439caad252558047c08e82044654496513 Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Thu, 4 Nov 2004 20:03:15 +0000 Subject: [PATCH] From: cmorgan@alum.wpi.edu svn path=/trunk/gtk-sharp/; revision=35666 --- doc/en/Gdk/Pixbuf.xml | 15 ++++++++++++++- doc/en/Gtk/TreeView.xml | 15 +++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/doc/en/Gdk/Pixbuf.xml b/doc/en/Gdk/Pixbuf.xml index 6b4014754..3c56f702b 100644 --- a/doc/en/Gdk/Pixbuf.xml +++ b/doc/en/Gdk/Pixbuf.xml @@ -1211,7 +1211,20 @@ Makes a new Pixbuf object from a . a a - + Useful for creating a Pixbuf from an image file that resides in memory. + + + +/* buffer containing an image */ +System.Byte[] buffer = new System.Byte[256]; + +/* create a memory stream to the buffer */ +System.IO.MemoryStream memorystream = new System.IO.MemoryStream(buffer); + +/* create a pixbuf from the stream as if it was a file */ +Gdk.Pixbuf pb = new Gdk.Pixbuf(memorystream); + + diff --git a/doc/en/Gtk/TreeView.xml b/doc/en/Gtk/TreeView.xml index f208f08d0..e4c23d60a 100644 --- a/doc/en/Gtk/TreeView.xml +++ b/doc/en/Gtk/TreeView.xml @@ -1151,6 +1151,21 @@ CellRendererText text = new CellRendererText (); tree_view.AppendColumn ("title", text, "text", 0); + This example illustrates how you can control the "editable" attribute of a column on a row-by-row basis. + + + TreeStore store = new TreeStore (typeof (string), typeof(bool)); + + /* add a column that will display the 'string' from the store */ + /* note that we are binding the "text" value to column 0 of the store, and the "editable" value to the column 1 value of the store */ + /* this enables per-row control over the editable flag, if desired */ + tv.AppendColumn("My string", new CellRendererText(), "text", 0, "editable", 1); + + /* add a couple of rows to the treeview */ + store.AppendValues("You can edit this", true); + store.AppendValues("You can't edit this", false); + +