PushButton

PushButtonNew

Create a push button at a screen position

Syntax

Signature
PushButton     *PushButtonNew( int row, int col, const char *caption );

Arguments

row, col the screen row and left column of the button. 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 PushButton object, or NULL when row or col is NIL. Release it with PushButtonFree().

Description

Include xdev-wtui-classes.h. A new button starts released and without input focus. The default style puts angle brackets around the caption, and the default colors come from `SetColor()`.

Use `PushButtonSetSBlock()` to assign an action. The application handles input and can use `PushButtonHitTest()` to locate a mouse click. Give the button focus with `PushButtonSetFocus()` before calling `PushButtonSelect()` to activate it.

The terminal control sizes itself in rows and columns from its UTF-8 caption and style. The bitmap and pixel-based properties in xBase apply to graphical controls. 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