{<name>:} label {<string>}
Label sub-panel, text or image.
Panel window
Tab window
Table window
Menupane
<name>
A name to be given to the sub-panel for reference purposes.
<string>
The text of the label.
This can be omitted when the label is an image.
-bc=<color>
The background color for the label. When the label is an image label, a value
of no_change will use the color of the label’s
parent window. This is applicable to monochrome image files only. For
text labels the background color is inherited from the label’s window
parent and cannot be changed.
-cam=<num>
Display the num th cameo from a Fire image file (indicated
by the -cr switch).
-cr=<file(s)>
Display a raster image. This can be the name of one image file, or more
when a multiple image label is required (see -mul).
Multiple files should be comma-separated all enclosed within < and
>.
-dim=<screen_xy>
Define the dimensions of the label in pixels. This is usually redundant
because labels are by default created sized-to-fit, but is useful when
the size needs to be overridden. This is a two-element numeric array providing
width and height. If only one is required, the other can be set to -1
and will be ignored.
-fc=<color>
The foreground color for the image. This is applicable to monochrome images
only.
-fo=<font>
The font to be used for label text. This must be a fixed font. If omitted
the label inherits the font of its parent row or column. This is ignored
for image labels.
-gh
The label should be initially ghosted, i.e. insensitive to user-interaction.
-inv
Make the sub-panel invisible on creation.
-j=<just>
The justification of the label within its parent row or column. Within a parent row the
value should be one of L, M, R. Within a parent column the value should
be one of T, M or B. The default in both cases is M.
-link=<text>
The resize linkage
for the panel. This ties panel edges to one or more edges of the parent
window, with the result that when the parent window gets resized, the
panel gets automatically resized as well. <text>
is a combination of the characters L, R, T, B and M. A value of "LRTB"
means that the left, right, top and bottom edges of a sub-panel are linked
to its parent. The default value is "TL", which links the left
and top edges to the parent window but does no resizing because its right
and bottom edges are not linked. Note that the linkage is to edges of
the parent window, not to column/row extremities. More complicated linkage
requirements should be done via the window.resize
callback on the parent window.
-mul
Indicates that the label image (defined by -cr)
can be any of the cameos from a Fire menu image file. The label image
displayed at a particular time is cameo <n>,
where n is the value of the panel.value element.
Initially cameo 1 is displayed.
-pj=<just>
The position justification of the sub-panel within the panel window. This combined
with the -x and -y switches
can be used to position the sub-panel by one of its corners. The default
is ’TL’. It also defines the control point to be used when repositioning
the sub-panel after creation.
-res=<num>
Used in conjunction with the -cr switch, this defines
a scaling factor for the image. For example, a value of 0.5 will show the image half-size.
-tc=<color>
The color for label text (or the image frame color). If omitted the parent window "other color"
is used.
-th=<num>
Draw a frame of width <num>
pixels around the image. The color used is the parent window "other
color".
-tt=<string>
A tool tip to appear
when the user rests the mouse cursor over the panel. This feature is not available
in panel windows on Unix systems.
-x=<num>
The x position of the label relative to the top-left corner of its parent row
or column. If omitted, the label is placed adjacent to the previously
defined sub-panel.
-y=<num>
The y position of the label relative to the top-left corner of its parent row
or column. If omitted, the label is placed below the previously defined
sub-panel.
None
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.
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 }