|
Hi, Im trying to create a Gtk.TreeView that suport a ToggleButton. I create it normally but i dont know how to create the Gtk.TreeViewColumn and Gtk.TreeStore. Please, can somebody see my code and tell where did i wrong. In the example below, i create a treeview for songs, that has two columns: 1: Song; 2: Delete (whether the song must be deleted or not); Song is a normal text, but Delete is a ToggleButton. Here's the code: public class TreeViewExample { public static void Main () { Gtk.Application.Init (); new TreeViewExample (); Gtk.Application.Run (); } public TreeViewExample () { Gtk.Window window = new Gtk.Window ("TreeView Example"); window.SetSizeRequest (500,200); Gtk.TreeView tree = new Gtk.TreeView (); window.Add (tree); Gtk.TreeViewColumn Song = new Gtk.TreeViewColumn ("Song",new Gtk.CellRendererText(),"text",0); Gtk.TreeViewColumn Delete = new Gtk.TreeViewColumn ("Delete?",new Gtk.CellRendererToggle(),"toggle",1); tree.AppendColumn (Song); tree.AppendColumn (Delete); Gtk.ListStore musicListStore = new Gtk.ListStore (typeof (string), typeof (bool)); tree.Model = musicListStore; window.ShowAll (); } } Thanks for any help, and sorry for any mistake, my english is not very good. Gustavo. |
_______________________________________________ Mono-list maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-list
