set_content_update_callbackT_set_content_update_callbackSetContentUpdateCallbackSetContentUpdateCallbackset_content_update_callback (Operator)

Name

set_content_update_callbackT_set_content_update_callbackSetContentUpdateCallbackSetContentUpdateCallbackset_content_update_callback — Setzen einer Callback-Funktion bei Aktualisierung des Pufferinhalts.

Signatur

set_content_update_callback( : : WindowHandle, CallbackFunction, CallbackContext : )

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

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

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

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

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

void HWindow.SetContentUpdateCallback(IntPtr callbackFunction, HTuple callbackContext)

void HWindow.SetContentUpdateCallback(IntPtr callbackFunction, IntPtr callbackContext)

def set_content_update_callback(window_handle: HHandle, callback_function: int, callback_context: Union[int, HHandle]) -> None

Beschreibung

set_content_update_callbackset_content_update_callbackSetContentUpdateCallbackSetContentUpdateCallbackSetContentUpdateCallbackset_content_update_callback setzt die Callback-Funktion CallbackFunctionCallbackFunctionCallbackFunctionCallbackFunctioncallbackFunctioncallback_function, die immer dann aufgerufen wird, wenn sich der Inhalt des Pufferfensters WindowHandleWindowHandleWindowHandleWindowHandlewindowHandlewindow_handle ändert. Der Parameter CallbackContextCallbackContextCallbackContextCallbackContextcallbackContextcallback_context wird dabei immer an die Callback-Funktion übergeben.

Der Typ der Callback-Funktion CallbackFunctionCallbackFunctionCallbackFunctionCallbackFunctioncallbackFunctioncallback_function ist: Herror callback(void *context)

Auf Windows Systemen wird die __stdcall Aufrufkonvention verwendet: Herror __stdcall callback(void *context)

Die Callback-Funktion darf keinen HALCON Operator aufrufen. Dies ist undefiniertes Verhalten. Es wird empfohlen, nur wenig rechenintensive Aufgaben in der Callback-Funktion durchzuführen, z.B. das Setzen eines Flags oder das Anstoßen einer asynchronen Operation.

In Verbindung mit den Operatoren send_mouse_down_eventsend_mouse_down_eventSendMouseDownEventSendMouseDownEventSendMouseDownEventsend_mouse_down_event, send_mouse_up_eventsend_mouse_up_eventSendMouseUpEventSendMouseUpEventSendMouseUpEventsend_mouse_up_event und send_mouse_double_click_eventsend_mouse_double_click_eventSendMouseDoubleClickEventSendMouseDoubleClickEventSendMouseDoubleClickEventsend_mouse_double_click_event kann set_content_update_callbackset_content_update_callbackSetContentUpdateCallbackSetContentUpdateCallbackSetContentUpdateCallbackset_content_update_callback verwendet werden, um ein Fenster-Control für ein GUI Toolkit wie Qt zu erstellen. Das Control leitet Mausevents an den Puffer weiter, welcher das Control bei Änderungen des Fensterinhalts benachrichtigt, indem er CallbackFunctionCallbackFunctionCallbackFunctionCallbackFunctioncallbackFunctioncallback_function aufruft. Das Control kann dann den Inhalt das Puffers mit dump_window_imagedump_window_imageDumpWindowImageDumpWindowImageDumpWindowImagedump_window_image kopieren und schließlich anzeigen.

Achtung

set_content_update_callbackset_content_update_callbackSetContentUpdateCallbackSetContentUpdateCallbackSetContentUpdateCallbackset_content_update_callback benötigt die Bibliothek libcanvas, die auf Embedded-Systemen möglicherweise nicht verfügbar ist.

Ausführungsinformationen

Parameter

WindowHandleWindowHandleWindowHandleWindowHandlewindowHandlewindow_handle (input_control)  window HWindow, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Fenster-Handle.

CallbackFunctionCallbackFunctionCallbackFunctionCallbackFunctioncallbackFunctioncallback_function (input_control)  pointer HTupleintHTupleHtuple (integer) (IntPtr) (Hlong) (Hlong)

Callback Funktion bei Aktualisierung des Pufferinhalts.

CallbackContextCallbackContextCallbackContextCallbackContextcallbackContextcallback_context (input_control)  pointer HTupleUnion[int, HHandle]HTupleHtuple (integer / handle) (IntPtr / IntPtr) (Hlong / HHandle) (Hlong / handle)

Parameter für CallbackFunction.

Ergebnis

set_content_update_callbackset_content_update_callbackSetContentUpdateCallbackSetContentUpdateCallbackSetContentUpdateCallbackset_content_update_callback liefert den Wert TRUE, falls das Fenster gültig ist. Ansonsten wird eine Fehlerbehandlung durchgeführt.

Siehe auch

flush_bufferflush_bufferFlushBufferFlushBufferFlushBufferflush_buffer

Modul

Foundation