Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main (string[] args) {
- Gtk.init (ref args);
- var win = new Gtk.Window();
- var box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);
- var root = new Granite.Widgets.SourceList.ExpandableItem ("root");
- var sl = new Granite.Widgets.SourceList (root);
- root.add (new Granite.Widgets.SourceList.Item ("item1"));
- root.add (new Granite.Widgets.SourceList.Item ("item2"));
- root.add (new Granite.Widgets.SourceList.Item ("item3"));
- var item4 = new Granite.Widgets.SourceList.ExpandableItem ("sub");
- var sub1 = new Granite.Widgets.SourceList.Item ("sub1");
- sub1.icon = new ThemedIcon ("media-playback-start");
- var sub2 = new Granite.Widgets.SourceList.Item ("sub2");
- sub2.icon = new ThemedIcon ("media-playback-start");
- var sub3 = new Granite.Widgets.SourceList.Item ("sub3");
- sub3.icon = new ThemedIcon ("media-playback-start");
- item4.add (sub1);
- item4.add (sub2);
- item4.add (sub3);
- root.add (item4);
- box.pack_start (sl, false, false);
- var model = new Gtk.ListStore (1, typeof (int));
- var tree_view = new Gtk.TreeView.with_model (model);
- tree_view.insert_column_with_attributes (-1, "toto", new Gtk.CellRendererText(), "text", 0);
- box.pack_start (tree_view);
- win.add (box);
- win.show_all();
- Gtk.main();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement