I'm trying to implement MVC pattern in lazarus, I've created the model and the view (directly from the designer). Now, I'm writing the "controller", but when I try to re-assign the auto-generated method "Button.OnClick", I've a compilation error :
controller.pas(31,44) Error: Wrong number of parameters specified for call to "QuitBtn"
The constructor of the controller :
constructor TController.Create(AModel : TGame ; AView : TFArena);
begin
Model := AModel;
FView := AView;
{Compilation Error}
FView.Quit.OnClick := TController.QuitBtn;
end;
And the procedure :
procedure TController.QuitBtn(Sender : TObject);
begin
ShowMessage('MVC READY');
end;
Method auto-generated from lazarus
procedure TFArena.QuitClick(Sender: TObject);
begin
{Nothing because she's gonna be over assigned}
end;
So, the both avec the same parameter "Sender : TObject"
Thanks for reading