Assigning event from delphi

edited August 2011 in FastScript
I would like assing b.OnClick event from this sample code below, but not from script. So my question is: is it possible translate b.OnClick := @ButtonClick to delphi. Is there a way how to find a pointer to the 'ButtonClick' procedure from script and assign this pointer, something like


var
  m : TNotifyEvent;
begin
    TMethod(m).Code := ?? How To Find ('ButtonClick') ??
    TMethod(m).Data := B;
    TButton( B ).OnClick:=m;
sample script (b is pointer to existing button component)
procedure ButtonClick(Sender: TButton);
begin
  ShowMessage(Sender.Name);
end;

begin
  b.OnClick := @ButtonClick; 
end.

Thanks
Martin

Leave a Comment