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

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.