ClassesClassesClassesClasses | | | | Operators

set_content_update_callbackset_content_update_callbackSetContentUpdateCallbackset_content_update_callbackSetContentUpdateCallbackSetContentUpdateCallback (Operator)

Name

set_content_update_callbackset_content_update_callbackSetContentUpdateCallbackset_content_update_callbackSetContentUpdateCallbackSetContentUpdateCallback — Sets the callback for content updates in buffer window.

Signature

set_content_update_callback( : : WindowHandle, CallbackFunction, CallbackContext : )

Herror set_content_update_callback(const Hlong WindowHandle, const Hlong CallbackFunction, const Hlong CallbackContext)

Herror T_set_content_update_callback(const Htuple WindowHandle, const Htuple CallbackFunction, const Htuple CallbackContext)

Herror set_content_update_callback(const HTuple& WindowHandle, const HTuple& CallbackFunction, const HTuple& CallbackContext)

void HWindow::SetContentUpdateCallback(const HTuple& CallbackFunction, const HTuple& CallbackContext) const

void SetContentUpdateCallback(const HTuple& WindowHandle, const HTuple& CallbackFunction, const HTuple& CallbackContext)

void HWindow::SetContentUpdateCallback(void* CallbackFunction, void* CallbackContext) const

void HOperatorSetX.SetContentUpdateCallback(
[in] VARIANT WindowHandle, [in] VARIANT CallbackFunction, [in] VARIANT CallbackContext)

void HWindowX.SetContentUpdateCallback(
[in] Hlong CallbackFunction, [in] Hlong CallbackContext)

static void HOperatorSet.SetContentUpdateCallback(HTuple windowHandle, HTuple callbackFunction, HTuple callbackContext)

void HWindow.SetContentUpdateCallback(IntPtr callbackFunction, IntPtr callbackContext)

Description

set_content_update_callbackset_content_update_callbackSetContentUpdateCallbackset_content_update_callbackSetContentUpdateCallbackSetContentUpdateCallback sets a callback CallbackFunctionCallbackFunctionCallbackFunctionCallbackFunctionCallbackFunctioncallbackFunction, which is called whenever the contents of the buffer window WindowHandleWindowHandleWindowHandleWindowHandleWindowHandlewindowHandle change. The parameter CallbackContextCallbackContextCallbackContextCallbackContextCallbackContextcallbackContext is always passed to the callback.

The type of CallbackFunctionCallbackFunctionCallbackFunctionCallbackFunctionCallbackFunctioncallbackFunction is: Herror callback(void *context)

On Windows systems, the __stdcall calling convention is used: Herror __stdcall callback(void *context)

The callback function must not call a HALCON operator. Doing so is undefined behavior. It is advised to perform only computationally inexpensive tasks in the callback, e.g., setting a flag or triggering an asynchronous operation.

In combination with the operators send_mouse_down_eventsend_mouse_down_eventSendMouseDownEventsend_mouse_down_eventSendMouseDownEventSendMouseDownEvent, send_mouse_up_eventsend_mouse_up_eventSendMouseUpEventsend_mouse_up_eventSendMouseUpEventSendMouseUpEvent, and send_mouse_double_click_eventsend_mouse_double_click_eventSendMouseDoubleClickEventsend_mouse_double_click_eventSendMouseDoubleClickEventSendMouseDoubleClickEvent, set_content_update_callbackset_content_update_callbackSetContentUpdateCallbackset_content_update_callbackSetContentUpdateCallbackSetContentUpdateCallback can be used to create a buffer based control for a GUI Toolkit (such as Qt), where the control passes mouse events to the buffer, while the buffer notifies the control on changes by calling the function CallbackFunctionCallbackFunctionCallbackFunctionCallbackFunctionCallbackFunctioncallbackFunction. The control then can obtain the contents of the buffer with dump_window_imagedump_window_imageDumpWindowImagedump_window_imageDumpWindowImageDumpWindowImage and display them.

Attention

set_content_update_callbackset_content_update_callbackSetContentUpdateCallbackset_content_update_callbackSetContentUpdateCallbackSetContentUpdateCallback depends on the library libcanvas, which might not be available on embedded systems.

Parallelization

Parameters

WindowHandleWindowHandleWindowHandleWindowHandleWindowHandlewindowHandle (input_control)  window HWindow, HTupleHTupleHTupleHWindowX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong) (Hlong)

Window handle.

CallbackFunctionCallbackFunctionCallbackFunctionCallbackFunctionCallbackFunctioncallbackFunction (input_control)  pointer HTupleHTupleHTupleVARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong) (Hlong)

Callback for content updates.

CallbackContextCallbackContextCallbackContextCallbackContextCallbackContextcallbackContext (input_control)  pointer HTupleHTupleHTupleVARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong) (Hlong)

Parameter to CallbackFunction.

Result

If the window exists and is a buffer window, set_content_update_callbackset_content_update_callbackSetContentUpdateCallbackset_content_update_callbackSetContentUpdateCallbackSetContentUpdateCallback returns 2 (H_MSG_TRUE).

See also

flush_bufferflush_bufferFlushBufferflush_bufferFlushBufferFlushBuffer

Module

Foundation


ClassesClassesClassesClasses | | | | Operators