[Vala] Storing a list of delegates with targets?



Hello,

I am writing a program where I would like to have possibility to add
arbitrary amount of callbacks which must be delegates.

I would like to store them somewhere, and then call one after another when
it's appropriate.

My first step was

public class Test : Object {

  public void delegate MyFunc();
  private List<MyFunc> funcs = new List<MyFunc>();

  public void add(MyFunc func) {
    this.funcs.append(func);
  }
}

But vala compiler complains about the fact that delegates with targets
can't be used as generics.

Is there any clear way of doing this at the moment (I am using vala 0.30).

Marcin


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