ClassesClassesClassesClasses | | | | Operators

attach_drawing_object_to_windowattach_drawing_object_to_windowAttachDrawingObjectToWindowattach_drawing_object_to_windowAttachDrawingObjectToWindowAttachDrawingObjectToWindow (Operator)

Name

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

Signature

attach_drawing_object_to_window( : : WindowHandle, DrawID : )

Herror attach_drawing_object_to_window(const Hlong WindowHandle, const Hlong DrawID)

Herror T_attach_drawing_object_to_window(const Htuple WindowHandle, const Htuple DrawID)

Herror attach_drawing_object_to_window(const HTuple& WindowHandle, const HTuple& DrawID)

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

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

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

void HOperatorSetX.AttachDrawingObjectToWindow(
[in] VARIANT WindowHandle, [in] VARIANT DrawID)

void HWindowX.AttachDrawingObjectToWindow([in] IHDrawingObjectX* DrawID)

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

void HWindow.AttachDrawingObjectToWindow(HDrawingObject drawID)

Description

attach_drawing_object_to_windowattach_drawing_object_to_windowAttachDrawingObjectToWindowattach_drawing_object_to_windowAttachDrawingObjectToWindowAttachDrawingObjectToWindow attaches the drawing object DrawIDDrawIDDrawIDDrawIDDrawIDdrawID to the HALCON window specified in WindowHandleWindowHandleWindowHandleWindowHandleWindowHandlewindowHandle. 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_paramsSetDrawingObjectParamsset_drawing_object_paramsSetDrawingObjectParamsSetDrawingObjectParams.

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_callbackSetDrawingObjectCallbackset_drawing_object_callbackSetDrawingObjectCallbackSetDrawingObjectCallback for more details.

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

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_objDispObjdisp_objDispObjDispObj, disp_regiondisp_regionDispRegiondisp_regionDispRegionDispRegion, disp_imagedisp_imageDispImagedisp_imageDispImageDispImage and disp_xlddisp_xldDispXlddisp_xldDispXldDispXld, is stored internally in a graphical stack associated with the WindowHandleWindowHandleWindowHandleWindowHandleWindowHandlewindowHandle, so that they can be displayed together with the attached drawing object. These remain in the stack until the user calls clear_windowclear_windowClearWindowclear_windowClearWindowClearWindow or closes the window with close_windowclose_windowCloseWindowclose_windowCloseWindowCloseWindow.

The size of this graphical stack can be queried and modified with get_systemget_systemGetSystemget_systemGetSystemGetSystem and set_systemset_systemSetSystemset_systemSetSystemSetSystem, 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_mbuttonGetMbuttonget_mbuttonGetMbuttonGetMbutton or read_charread_charReadCharread_charReadCharReadChar, 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 appropiate, non-invasive alternative.

Furthermore, the event based functionality should not be used together with the former blocking operators draw_rectangle1draw_rectangle1DrawRectangle1draw_rectangle1DrawRectangle1DrawRectangle1, draw_rectangle2draw_rectangle2DrawRectangle2draw_rectangle2DrawRectangle2DrawRectangle2, draw_regiondraw_regionDrawRegiondraw_regionDrawRegionDrawRegion, draw_xlddraw_xldDrawXlddraw_xldDrawXldDrawXld or draw_circledraw_circleDrawCircledraw_circleDrawCircleDrawCircle. 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.

Parallelization

Parameters

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

Window handle.

DrawIDDrawIDDrawIDDrawIDDrawIDdrawID (input_control)  drawing_object HDrawingObject, HTupleHTupleHDrawingObject, HTupleHDrawingObjectX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong) (Hlong)

Handle of the drawing object.

Result

attach_drawing_object_to_windowattach_drawing_object_to_windowAttachDrawingObjectToWindowattach_drawing_object_to_windowAttachDrawingObjectToWindowAttachDrawingObjectToWindow returns 2 (H_MSG_TRUE), if the DrawIDDrawIDDrawIDDrawIDDrawIDdrawID and WindowHandleWindowHandleWindowHandleWindowHandleWindowHandlewindowHandle are valid. Otherwise an exception is raised.

Possible Predecessors

create_drawing_object_rectangle1create_drawing_object_rectangle1CreateDrawingObjectRectangle1create_drawing_object_rectangle1CreateDrawingObjectRectangle1CreateDrawingObjectRectangle1, create_drawing_object_xldcreate_drawing_object_xldCreateDrawingObjectXldcreate_drawing_object_xldCreateDrawingObjectXldCreateDrawingObjectXld, create_drawing_object_circle_sectorcreate_drawing_object_circle_sectorCreateDrawingObjectCircleSectorcreate_drawing_object_circle_sectorCreateDrawingObjectCircleSectorCreateDrawingObjectCircleSector, create_drawing_object_ellipse_sectorcreate_drawing_object_ellipse_sectorCreateDrawingObjectEllipseSectorcreate_drawing_object_ellipse_sectorCreateDrawingObjectEllipseSectorCreateDrawingObjectEllipseSector, create_drawing_object_ellipsecreate_drawing_object_ellipseCreateDrawingObjectEllipsecreate_drawing_object_ellipseCreateDrawingObjectEllipseCreateDrawingObjectEllipse, create_drawing_object_linecreate_drawing_object_lineCreateDrawingObjectLinecreate_drawing_object_lineCreateDrawingObjectLineCreateDrawingObjectLine, create_drawing_object_rectangle2create_drawing_object_rectangle2CreateDrawingObjectRectangle2create_drawing_object_rectangle2CreateDrawingObjectRectangle2CreateDrawingObjectRectangle2, create_drawing_object_circlecreate_drawing_object_circleCreateDrawingObjectCirclecreate_drawing_object_circleCreateDrawingObjectCircleCreateDrawingObjectCircle, create_drawing_object_textcreate_drawing_object_textCreateDrawingObjectTextcreate_drawing_object_textCreateDrawingObjectTextCreateDrawingObjectText

Possible Successors

detach_drawing_object_from_windowdetach_drawing_object_from_windowDetachDrawingObjectFromWindowdetach_drawing_object_from_windowDetachDrawingObjectFromWindowDetachDrawingObjectFromWindow, get_drawing_object_paramsget_drawing_object_paramsGetDrawingObjectParamsget_drawing_object_paramsGetDrawingObjectParamsGetDrawingObjectParams, get_drawing_object_iconicget_drawing_object_iconicGetDrawingObjectIconicget_drawing_object_iconicGetDrawingObjectIconicGetDrawingObjectIconic

See also

set_drawing_object_callbackset_drawing_object_callbackSetDrawingObjectCallbackset_drawing_object_callbackSetDrawingObjectCallbackSetDrawingObjectCallback, get_drawing_object_iconicget_drawing_object_iconicGetDrawingObjectIconicget_drawing_object_iconicGetDrawingObjectIconicGetDrawingObjectIconic, get_drawing_object_paramsget_drawing_object_paramsGetDrawingObjectParamsget_drawing_object_paramsGetDrawingObjectParamsGetDrawingObjectParams

Module

Foundation


ClassesClassesClassesClasses | | | | Operators