Jump to content

Recommended Posts

9 minutes ago, A.M. Hoornweg said:

Static class methods are unable to access any members or methods that require a "self" parameter.  

As a result it can not be assigned to an event.

Share this post


Link to post
10 hours ago, dummzeuch said:

Alternatively one could create a plain procedure with the right signature, assign that to the code pointer of a TMethod record, leave the data pointer unassigned or set it to nil, and assign that record to the event using appropriate type casting.

That's the way I usually do it when I need an event handler without an object instance.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×