I need to use procedure ClicaItem(Sender: TObject);
in a OnClick
created at run time by calling procedure CriaItem(nome:String);
.
However, in all my attempts, I could not assign item.OnClick
to procedure ClicaItem
. How do I proceed if an error occurs regarding incompatible types?
Error: Incompatible types: got address of procedure (TObject); Register "expected" procedure variable type of procedure (TObject) of object; Register > "
I want to clarify the procedure creation to the type accepted by OnClick, as well as how to do this assignment in the OnClick
event.
NOTE: The item is normally created in runtime, but the line referring to OnClick is commented on due to the error before compiling.