[Vala] Type of data in TreeView



Hello all,

I want to add any type of data to a TreeView.
What is the best option to do this ?

a) a void* type:
var tree_store = new TreeStore (2, typeof (string), typeof (void*));

b) a generics type:
public class Gen <G> : GLib.Object
{
  private G _data;
  public void set_data (G data) { _data = data; }
  public G get_data () { return _data; }
}
var tree_store =new TreeStore (2, typeof (string), typeof (Gen));

c) Store the data in a tree outside the TreeStore and accessing each data with a path or something...

I want to add inside a TreeStore anything (string, int, float, Object, etc.)
Matias


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]