Panel: text

Syntax

{<name>:} text {<string>}

Description

Text input sub-panel. The box may be single or multi-line.

Membership

Parameters

Switches

Callbacks

Called as the text panel is about to lose the keyboard focus. If a non-empty after callback exists for the panel, the focus remains with the panel until directed elsewhere by a focus command.

<panel>.after(<window>,<panel>{,<row>})

Called as the text box receives the keyboard focus.

<panel>.before(<window>,<panel>{,<row>})

Called when:

    <Return> is hit in a single line text box,
    <Ctrl-Return> is hit in a multi-line text box.

<panel>.exec(<window>,<panel>{,<row>})

Notes

Switches -j, -pj, -x and -y apply only to text boxes within a panel window. Text boxes within other windows cannot have a user-defined position or justification.

Examples

Create a panel window containing a labelled single line text box of character width. The font gets set via a row definition.

window w = wpanel {
    row -fo=big_xfont {
        label 'Name:'
        nam: text -c=32
    }
}

Create a similar text box window with color changes and an initial value.

window w = wpanel {
    row {
        label 'Name:'
        nam: text 'Beauregard',-c=32,-bc=white,-tc=red
    }
}

Create a panel window containing a multi-line text box. The maximum number of input lines is set to 10. The visible number of rows is set to 5. Word-wrap is also set.

window w = wpanel {
    t: text -c=48,-r=5,-max=10,-bc=white,-ww
}