vbox#set_spacing 5;
let cols = new GTree.column_list in
- (*let col_icon = cols#add Gobject.Data.string in*)
+ (* http://plus.kaist.ac.kr/~shoh/ocaml/lablgtk2/treeview-tutorial/ch05s08.html *)
+ let col_icon = cols#add (Gobject.Data.gobject_by_name "GdkPixbuf") in
let col_name = cols#add Gobject.Data.string in
let model = GTree.list_store cols in
~packing:(vbox#pack ~expand:true ~fill:true) () in
icons#set_border_width 4;
- (*icons#set_pixbuf_column col_icon;*)
+ icons#set_pixbuf_column col_icon;
icons#set_text_column col_name;
let refresh () =
model#clear ();
let services = !find_libvirtd_with_zeroconf () in
- (*let pixbuf = !icon_16x16_devices_computer_png in*)
+ let pixbuf = !icon_32x32_devices_computer_png in
List.iter (
fun (name, _) ->
let row = model#append () in
model#set ~row ~column:col_name name;
- (*match pixbuf with
- | None -> ()
- | Some pixbuf -> model#set ~row ~column:col_icon pixbuf*)
+ match pixbuf with
+ | None -> ()
+ | Some pixbuf -> model#set ~row ~column:col_icon pixbuf
) services
in
refresh ();