A label is a dialog_item object used to inform the user. It's selection is either a string or an image. This selection is the only visual part of a label. Labels are normally used to provide feedback inside a dialog window or to describe a group of dialog_items.
Labels play a role in the predefined (error) reporting system
initiated by object->report.
If a label object named reporter
appears in a dialog
object, the dialog's dialog<-report_to,
combined with visual<-report_to
ensures that all status, warning and error messages initiated by label->report
will be displayed by this label. See label->report
and visual->report.
It is possible to attach a message to a label, which is than executed when the user presses the label with the left button. This use is not advocated.
<-selection’s
value is a char_array
object (text).ex units (i.e.
width of the character
x in the current label<-font).|image<-font.
The field width is described by label<-length.
If the actual text does not fit in the field the label is automatically
enlarged.
<-selection.
If the selection is a name
object and the method is known to class string,
the selection will automatically be translated into a string
object. This implies that a label that displays a name still understands
all methods defined on class string.
Notably string->append, and
string->format
are commonly used methods.<-area
of the label from the label<-selection.
If the selection is text and the width of the text is smaller than label<-length
times
label<-fontlabel<-ex,
the width is made equal to this value. This will reserver sufficient
space when the label is placed by the automatic‘dialog
graphical->layout’mechanism.<-message
is defined.
First invokes dialog_item->event.
If this fails and graphical<-active
== @on and dialog_item<-message
is not @nil,
forward dialog_item<-message
on a left-click. Uses @_button_gesture.
<-message.
Arguments:
@receiver the label
This method is normally invoked from label->event
through a click_gesture
object.
<-selection.
Equivalent to:
send(Label, selection, string(Format, Argument ...)).
|image], font=[font]<-member)
and its selection. The default name is reporter, which
makes the label the reporter of the dialog (see dialog<-report_to).
The default selection is” . The default font is determined by
label.font.
The width a label
object requires on the window is determined by
label->length,
whose default is determined by the resource
label.length.
->format
the message in the label. If the type of the information is either
warning or error it will invoke graphical->flash
on @reportee.
Note that class dialog
redefines visual<-report_to
(see dialog<-report_to).
If a label is called reporter (see graphical<-name),
the dialog will delegate label->report
messages to this label.
Kind is progress is equivalent to status, but
sends label->flush to update the display
immediately after changing the
label<-selection. Kind
is done appends the formatted text to the current label<-selection
of the label. If format is @default,
done is appended to the selection.
<-selection
is an image object the
image is scaled to this width and the height is scale proportionally.