Hey guys... I'm working on a tiny gui unit for use in my game projects. One of the things I'd like it to do is associate external procedures and execute them if assigned for say a button click.

Assigning them would be as simple as

[pascal]MainMenu.Button1.OnClick := YourProcedure;[/pascal]

YourProcedure() would be created by the user of the library. And Button1 would be a control object that resides inside the window object (MainMenu).

[pascal]procedure YourProcedure;
begin
// whatever
end;[/pascal]

my code to detect mouse clicks on the button object would run the 'linked' procedure from it's own code. How can I do this? Can I simply use pointers?