callback

From Lazarus wiki
Revision as of 01:39, 17 November 2020 by Arent (talk | contribs) (Created page with "'''Callback''' functions are in widespread usage in Lazarus; in fact any Event is made available using 'callback'. type TForm = class(TForm) btn: TButton; proc...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Callback functions are in widespread usage in Lazarus; in fact any Event is made available using 'callback'.

type
 TForm = class(TForm)
   btn: TButton;
   procedure btnClick(Sender: TObject);
 end;
...
 procedure TForm.btnClick(Sender: TObject);
 begin
  // dosomething
 end;

The btnClick method is a callback from within the TButton implementation.

Apart from their use in the userinterface of a form, callbacks are used in many libraries that were linked.