Re: [Vala] Transfer of delegates



Hello,

                            في ر، 05-10-2011 عند 17:15 +0200 ، كتب tomw:
Hi, 

I know that there has been some discussion on this subject. Reading
through [1] and [2] I tried the following approach to pass a delegate
method to a class and to execute it there like:

[...]
What am I missing? Any enlightenment appreciated...

You need either:

unowned Handler handle;
public MyClass (Handler? handle) {
  this.handle = handle;
}

or

Handler handle;
public MyClass (owned Handler? handle) {
  this.handle = (owned) handle;
}

(the latter is probably what you want).

HTH,
Abderrahim




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