CheckBox

CheckBoxNew

Create an unchecked check box at a screen position

Syntax

Signature
CheckBox     *CheckBoxNew( int row, int col, const char *caption );

Arguments

row, col the screen row and left column of the box. NIL is invalid for either coordinate.

caption the UTF-8 text to copy, or NULL for an empty caption. & marks the following character as the accelerator.

Return value

The new CheckBox object, or NULL when row or col is NIL. Release it with CheckBoxFree().

Description

Include xdev-wtui-classes.h. The caption starts on the same row at `col + 4`, one space after the three-cell box. The object starts unchecked and without input focus. The default style is `"[√ ]"`, and the default colors come from `SetColor()`.

Call `CheckBoxDisplay()` to draw the control. The application handles input and calls `CheckBoxSelect()` to set or toggle the state. For mouse input, use `CheckBoxHitTest()` to identify clicks on the box or caption.

The C API draws the check box with terminal characters and colors. The xBase bitmap property applies to graphical mode. The C methods for drawing, selecting and changing focus return a logical result so the caller can check the operation directly. The corresponding xBase methods return the object.

See also