Operator Reference

attach_drawing_object_to_windowT_attach_drawing_object_to_windowAttachDrawingObjectToWindowAttachDrawingObjectToWindowattach_drawing_object_to_window (Operator)

attach_drawing_object_to_windowT_attach_drawing_object_to_windowAttachDrawingObjectToWindowAttachDrawingObjectToWindowattach_drawing_object_to_window — Attach an existing drawing object to a HALCON window.

Signature

attach_drawing_object_to_window( : : WindowHandle, DrawHandle : )

Herror T_attach_drawing_object_to_window(const Htuple WindowHandle, const Htuple DrawHandle)

void AttachDrawingObjectToWindow(const HTuple& WindowHandle, const HTuple& DrawHandle)

void HWindow::AttachDrawingObjectToWindow(const HDrawingObject& DrawHandle) const

static void HOperatorSet.AttachDrawingObjectToWindow(HTuple windowHandle, HTuple drawHandle)

void HWindow.AttachDrawingObjectToWindow(HDrawingObject drawHandle)

def attach_drawing_object_to_window(window_handle: HHandle, draw_handle: HHandle) -> None

Description

attach_drawing_object_to_windowattach_drawing_object_to_windowAttachDrawingObjectToWindowAttachDrawingObjectToWindowattach_drawing_object_to_window attaches the drawing object DrawHandleDrawHandleDrawHandledrawHandledraw_handle to the HALCON window specified in WindowHandleWindowHandleWindowHandlewindowHandlewindow_handle. When attached to a window the drawing object is displayed in the specified window. The drawing object can be modified interactively in the HALCON window. The window is automatically updated when the objects properties are modified using the operator set_drawing_object_paramsset_drawing_object_paramsSetDrawingObjectParamsSetDrawingObjectParamsset_drawing_object_params.

When two or more drawing objects overlap, a double-click on the currently selected drawing object will shift the focus to the next drawing object.

Furthermore it is possible to react to modifications of the drawing object caused by user interaction when using any of the language interface. Please see the documentation of set_drawing_object_callbackset_drawing_object_callbackSetDrawingObjectCallbackSetDrawingObjectCallbackset_drawing_object_callback for more details.

The drawing object can be removed from the current window with the operator detach_drawing_object_from_windowdetach_drawing_object_from_windowDetachDrawingObjectFromWindowDetachDrawingObjectFromWindowdetach_drawing_object_from_window.

As soon as a drawing object is attached to the window, each HALCON object which is displayed by any of the graphical operators, namely disp_objdisp_objDispObjDispObjdisp_obj, disp_regiondisp_regionDispRegionDispRegiondisp_region, disp_imagedisp_imageDispImageDispImagedisp_image and disp_xlddisp_xldDispXldDispXlddisp_xld, is stored internally in a graphical stack associated with the WindowHandleWindowHandleWindowHandlewindowHandlewindow_handle, so that they can be displayed together with the attached drawing object. These remain in the stack until the user calls clear_windowclear_windowClearWindowClearWindowclear_window or the window is closed.

The size of this graphical stack can be queried and modified with get_systemget_systemGetSystemGetSystemget_system and set_systemset_systemSetSystemSetSystemset_system, respectively. See the corresponding documentation reference for further details.

Attention

Note that using any synchronous operator which actively probe the event queue, e.g., get_mbuttonget_mbuttonGetMbuttonGetMbuttonget_mbutton or read_charread_charReadCharReadCharread_char, will conflict with the interaction with the drawing objects. In case you need to read the state of the cursor, please refer to the documentation of your framework of choice for an appropriate, non-invasive alternative.

Furthermore, the event based functionality should not be used together with the former blocking operators draw_rectangle1draw_rectangle1DrawRectangle1DrawRectangle1draw_rectangle1, draw_rectangle2draw_rectangle2DrawRectangle2DrawRectangle2draw_rectangle2, draw_regiondraw_regionDrawRegionDrawRegiondraw_region, draw_xlddraw_xldDrawXldDrawXlddraw_xld or draw_circledraw_circleDrawCircleDrawCircledraw_circle. They conflict with the event based functionality, since they actively fetch all events sent to the HALCON window.

When working under UNIX/Linux it is necessary to turn on the support for multithreading in the Xlib. This is achieved by calling the function XInitThreads() before any other function of the Xlib library. This means that you need to call it before any other function or method of your graphical development environment of choice. See the documentation of the function XInitThreads() in the corresponding manual page for further details.

Execution Information

  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).
  • Multithreading scope: global (may be called from any thread).
  • Processed without parallelization.

Parameters

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

Window handle.

DrawHandleDrawHandleDrawHandledrawHandledraw_handle (input_control)  drawing_object HDrawingObject, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Handle of the drawing object.

Result

attach_drawing_object_to_windowattach_drawing_object_to_windowAttachDrawingObjectToWindowAttachDrawingObjectToWindowattach_drawing_object_to_window returns 2 ( H_MSG_TRUE) , if the DrawHandleDrawHandleDrawHandledrawHandledraw_handle and WindowHandleWindowHandleWindowHandlewindowHandlewindow_handle are valid. Otherwise an exception is raised.

Possible Predecessors

create_drawing_object_rectangle1create_drawing_object_rectangle1CreateDrawingObjectRectangle1CreateDrawingObjectRectangle1create_drawing_object_rectangle1, create_drawing_object_xldcreate_drawing_object_xldCreateDrawingObjectXldCreateDrawingObjectXldcreate_drawing_object_xld, create_drawing_object_circle_sectorcreate_drawing_object_circle_sectorCreateDrawingObjectCircleSectorCreateDrawingObjectCircleSectorcreate_drawing_object_circle_sector, create_drawing_object_ellipse_sectorcreate_drawing_object_ellipse_sectorCreateDrawingObjectEllipseSectorCreateDrawingObjectEllipseSectorcreate_drawing_object_ellipse_sector, create_drawing_object_ellipsecreate_drawing_object_ellipseCreateDrawingObjectEllipseCreateDrawingObjectEllipsecreate_drawing_object_ellipse, create_drawing_object_linecreate_drawing_object_lineCreateDrawingObjectLineCreateDrawingObjectLinecreate_drawing_object_line, create_drawing_object_rectangle2create_drawing_object_rectangle2CreateDrawingObjectRectangle2CreateDrawingObjectRectangle2create_drawing_object_rectangle2, create_drawing_object_circlecreate_drawing_object_circleCreateDrawingObjectCircleCreateDrawingObjectCirclecreate_drawing_object_circle, create_drawing_object_textcreate_drawing_object_textCreateDrawingObjectTextCreateDrawingObjectTextcreate_drawing_object_text

Possible Successors

detach_drawing_object_from_windowdetach_drawing_object_from_windowDetachDrawingObjectFromWindowDetachDrawingObjectFromWindowdetach_drawing_object_from_window, get_drawing_object_paramsget_drawing_object_paramsGetDrawingObjectParamsGetDrawingObjectParamsget_drawing_object_params, get_drawing_object_iconicget_drawing_object_iconicGetDrawingObjectIconicGetDrawingObjectIconicget_drawing_object_iconic

See also

set_drawing_object_callbackset_drawing_object_callbackSetDrawingObjectCallbackSetDrawingObjectCallbackset_drawing_object_callback, get_drawing_object_iconicget_drawing_object_iconicGetDrawingObjectIconicGetDrawingObjectIconicget_drawing_object_iconic, get_drawing_object_paramsget_drawing_object_paramsGetDrawingObjectParamsGetDrawingObjectParamsget_drawing_object_params

Module

Foundation