Playing with the new RTTI module, I could not find a way to install an event handler with new utilities. Try something like this:
LProp := TRttiContext.Create.GetType(Form1.ClassInfo).AsInstance.GetProperty('OnClick'); LProp.SetValue(Form1, {a TValue!});
SetValue needs a TValue broadcast, but I have not yet found a way to present TMethod via TValue. Any comments?
ps. And a side question. The prefix of RTTI variables with "L" seems to be a convention (and a good IMO, the meta code turns into a puzzle very quickly). But what is it really worth?
source share