Platforms to show: All Mac Windows Linux Cross-Platform

Back to DeclareCallBackMBS class.

DeclareCallBackMBS.Constructor(Signature as String)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynamicDeclares MBS Util Plugin 20.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a new callback object.

Please pass a valid signature, e.g. "(pi)v" for a function taking one pointer, one integer and return nothing (void).
If the signature doesn't match the values put on the stack, the app may crash.

DeclareCallBackMBS.ParameterCFRetain(Index as Integer) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property DynamicDeclares MBS Util Plugin 20.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets whether a parameter needs to be retained via CFRetain() call.

If the callback is within Apple's frameworks passing a CoreFoundation object, you can set this property to true, so we call CFRetain method on it in the callback and later release when the Xojo event was called.
This allows to avoid crashes with CoreFoundation objects passed from one thread to another thread for multi threaded callbacks.

Parameter must be of type pointer.
(Read and Write computed property)

DeclareCallBackMBS.ParameterCopyString(Index as Integer) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property DynamicDeclares MBS Util Plugin 20.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets whether a parameter needs to be copied as a zero terminated string.

If the callback receives a C string, you can set this property to true, so we copy it in the callback and later release when the Xojo event was called.
This allows to avoid crashes with strings passed from one thread to another thread for multi threaded callbacks.

Parameter must be of type pointer or string.
(Read and Write computed property)

DeclareCallBackMBS.ParameterNSRetain(Index as Integer) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property DynamicDeclares MBS Util Plugin 20.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets whether a parameter needs to be retained via [NSObject retain] call.

If the callback is within Apple's frameworks passing a Objective-C object, you can set this property to true, so we call retain method on it in the callback and later release when the Xojo event was called.
This allows to avoid crashes with NSObject objects passed from one thread to another thread for multi threaded callbacks.

Parameter must be of type pointer.
(Read and Write computed property)

DeclareCallBackMBS.ParameterType(Index as Integer) as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
method DynamicDeclares MBS Util Plugin 20.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Queries type of a parameter.

Index in range from 0 to ParameterCount-1.

The items on this page are in the following plugins: MBS Util Plugin.


The biggest plugin in space...