[Lazarus] Menu Click Event in Runtime

Rogério Martins rogmartins at gmail.com
Fri Apr 29 19:59:27 CEST 2011


It worked

Thanks!

2011/4/29 Marcos Douglas <md at delfire.net>

> 2011/4/29 Rogério Martins <rogmartins at gmail.com>:
> > Hi !
> >
> > How do i make an assignment between a TMenuItem.OnClick event and the
> > procedure xyz (Sender: TObject)  at runtime ?
> >
> > In Delphi i just do:
> >
> > menuItem.OnClick := MenuClick;
> > where procedure declaration is procedure MenuClick(Sender: TObject);
> >
> > In lazarus, this code does not compile.
> >
> > How do i correct this ?
>
> Use:
> menuItem.OnClick := @MenuClick;
>
> Marcos Douglas
>
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>



-- 
The Ubuntu Counter Project - user number #
33192<http://ubuntucounter.geekosophical.net>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20110429/978bc7eb/attachment-0003.html>


More information about the Lazarus mailing list