write_stringT_write_stringWriteStringWriteStringwrite_string (Operator)
Name
write_stringT_write_stringWriteStringWriteStringwrite_string
— Print text in a window.
Signature
def write_string(window_handle: HHandle, string: MaybeSequence[Union[int, float, str]]) -> None
Description
write_stringwrite_stringWriteStringWriteStringwrite_string
prints StringStringStringstringValstring
in the output
window starting at the current cursor position. The output text has to fit
within the right window boundary (the width of the string can be queried
by get_string_extentsget_string_extentsGetStringExtentsGetStringExtentsget_string_extents
).
The font currently assigned to the window will used. The text cursor is
positioned at the end of the text.
write_stringwrite_stringWriteStringWriteStringwrite_string
can output all three types of data used in HALCON .
The conversion to a string is guided by the following rules:
-
strings are not converted.
-
integer numbers are converted without any spaces before or
after the number.
-
floating numbers are printed (if possible) with a floating point
and without an exponent.
-
the resulting strings are concatenated without spaces.
For buffering of texts see set_systemset_systemSetSystemSetSystemset_system
with the flag
'flush_graphic'.
Attention
If clipping at the window boundary is desired, exceptions can be switched
off by set_check('~text')set_check("~text")SetCheck("~text")SetCheck("~text")set_check("~text")
.
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.
StringStringStringstringValstring
(input_control) string(-array) →
HTupleMaybeSequence[Union[int, float, str]]HTupleHtuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double)
Tuple of output values (all types).
Default:
'hello'
"hello"
"hello"
"hello"
"hello"
Result
write_stringwrite_stringWriteStringWriteStringwrite_string
returns 2 (
H_MSG_TRUE)
if the window is valid and the
output text fits within the current line (see set_checkset_checkSetCheckSetCheckset_check
).
Otherwise an exception is raised.
Possible Predecessors
open_windowopen_windowOpenWindowOpenWindowopen_window
,
set_fontset_fontSetFontSetFontset_font
,
get_string_extentsget_string_extentsGetStringExtentsGetStringExtentsget_string_extents
Alternatives
fwrite_stringfwrite_stringFwriteStringFwriteStringfwrite_string
See also
set_tpositionset_tpositionSetTpositionSetTpositionset_tposition
,
get_string_extentsget_string_extentsGetStringExtentsGetStringExtentsget_string_extents
,
set_fontset_fontSetFontSetFontset_font
,
set_systemset_systemSetSystemSetSystemset_system
,
set_checkset_checkSetCheckSetCheckset_check
Module
Foundation