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
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
- Multithreading-Typ: reentrant (läuft parallel zu nicht-exklusiven Operatoren).
- Multithreading-Bereich: global (kann von jedem Thread aufgerufen werden).
- Wird ohne Parallelisierung verarbeitet.
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 2 (H_MSG_TRUE), falls das Fenster
gültig ist. Ansonsten wird eine Fehlerbehandlung durchgeführt.
Siehe auch
flush_bufferflush_bufferFlushBufferFlushBufferFlushBufferflush_buffer
Modul
Foundation