Panel: label

Syntax

{<name>:} label {<string>}

Description

Label sub-panel, text or image.

Membership

Parameters

Switches

Callbacks

None

Notes

Switches -j, -mul, -pj, -x and -y apply only to buttons within a panel window. Labels within other windows and menupanes cannot have a user-defined position or justification.

Examples

Create a panel window containing a text input box labeled with a text label.

window w = wpanel {
    row {
        label 'Name:'
        t: text
    }
}

Create a panel window containing a button and a multiple image label with a border. A callback has been assigned to the button to show the next image in the permitted range.

window w = wpanel {
    row {
        b: button 'Next:'
        img: label -mul,-cr='myimages.ras',-th=2
    }
}
w.b.exec = {
    args w=window
# Wrap around if necessary
    if (w.img.value >= w.img.image.alength)
        w.img.value = 1
    else
        w.img.value++
}

Create a panel window containing an image label used as the panel background, and two text buttons placed in opposite corners of the window.

numeric size[] = raspix(bground.ras)
window w = wpanel {
    label -cr='bground.ras'
    apply: button 'Apply',-x=10,-y=10
    cancel: button 'Cancel',-pj='BL',\ 
        -x=size[1]-10,-y=size[2]-10
}