KlassenKlassenKlassenKlassen | | | | Operatoren

set_content_update_callbackset_content_update_callbackSetContentUpdateCallbackset_content_update_callbackSetContentUpdateCallbackSetContentUpdateCallback (Operator)

Name

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

Signatur

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)

Beschreibung

set_content_update_callbackset_content_update_callbackSetContentUpdateCallbackset_content_update_callbackSetContentUpdateCallbackSetContentUpdateCallback setzt die Callback-Funktion CallbackFunctionCallbackFunctionCallbackFunctionCallbackFunctionCallbackFunctioncallbackFunction, die immer dann aufgerufen wird, wenn sich der Inhalt des Pufferfensters WindowHandleWindowHandleWindowHandleWindowHandleWindowHandlewindowHandle ändert. Der Parameter CallbackContextCallbackContextCallbackContextCallbackContextCallbackContextcallbackContext wird dabei immer an die Callback-Funktion übergeben.

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

Auf Windows Systemen wird die __stdcall calling convention 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_eventSendMouseDownEventsend_mouse_down_eventSendMouseDownEventSendMouseDownEvent, send_mouse_up_eventsend_mouse_up_eventSendMouseUpEventsend_mouse_up_eventSendMouseUpEventSendMouseUpEvent und send_mouse_double_click_eventsend_mouse_double_click_eventSendMouseDoubleClickEventsend_mouse_double_click_eventSendMouseDoubleClickEventSendMouseDoubleClickEvent kann set_content_update_callbackset_content_update_callbackSetContentUpdateCallbackset_content_update_callbackSetContentUpdateCallbackSetContentUpdateCallback verwendet werden, um ein Fenster-Control für ein GUI Toolkit wie Qt zu erstellen. Das Controll leitet Mausevents an den Puffer weiter, welcher das Control bei Änderungen des Fensterinhalts benachrichtigt, indem er CallbackFunctionCallbackFunctionCallbackFunctionCallbackFunctionCallbackFunctioncallbackFunction aufruft. Das Control kann dann den Inhalt das Puffers mit dump_window_imagedump_window_imageDumpWindowImagedump_window_imageDumpWindowImageDumpWindowImage kopieren und schließlich anzeigen.

Achtung

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

Parallelisierung

Parameter

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

Fenster-Handle.

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

Callback Funktion bei Aktualisierung des Pufferinhalts.

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

Parameter für CallbackFunction.

Ergebnis

set_content_update_callbackset_content_update_callbackSetContentUpdateCallbackset_content_update_callbackSetContentUpdateCallbackSetContentUpdateCallback liefert den Wert 2 (H_MSG_TRUE), falls das Fenster gültig ist. Ansonsten wird eine Fehlerbehandlung durchgeführt.

Siehe auch

flush_bufferflush_bufferFlushBufferflush_bufferFlushBufferFlushBuffer

Modul

Foundation


KlassenKlassenKlassenKlassen | | | | Operatoren