## label.api
#
# "A label widget allows the programmer to put unadorned
# text in the interface. The text and colors are mutable,
# under control of the programmer.
#
# "A label is created by supplying a display root, an initial
# label string, an optional font, optional foreground and
# background colors and an alignment. On the screen, a label
# consists of the string written in the given foreground
# color (black by default) on the given background color
# (by default, the parent's background). The font argument
# specifies the name of the font to use (the 8x13 font is
# used by default)."
#
# -- p26, Gansner+Reppy's 1993 eXene widget manual:
# http://mythryl.org/pub/exene/1993-widgets.ps
#
# The current label implementation can display text or an image.
#
# If displaying text, a label expresses a best_size
# size preference high enough to contain any string written
# in the font and wide enough to contain the current string
# plus some padding; it specifies no shrinking or stretching.
#
# If the window provided is larger than necessary the string
# is aligned per the 'align' argument.
#
# The label's visual appearance may be dynamically modified
# after creation (and realization) using
#
# set_label
# set_background
# set_foreground
# Compiled by:
#
src/lib/x-kit/widget/xkit-widget.sublib# This api is implemented in:
#
#
src/lib/x-kit/widget/old/leaf/label.pkgstipulate
package wg = widget; # widget is from
src/lib/x-kit/widget/old/basic/widget.pkg package xc = xclient; # xclient is from
src/lib/x-kit/xclient/xclient.pkg package wt = widget_types; # widget_types is from
src/lib/x-kit/widget/old/basic/widget-types.pkgherein
api Label {
Label;
Label_Type = TEXT String
| ICON xc::Ro_Pixmap
;
make_label'
:
(wg::Root_Window, wg::View, List(wg::Arg))
->
Label;
make_label
:
wg::Root_Window
->
{ label: String,
#
font: Null_Or( String ),
foreground: Null_Or( xc::Rgb ),
background: Null_Or( xc::Rgb ),
#
align: wt::Horizontal_Alignment
}
->
Label;
as_widget: Label -> wg::Widget;
set_label: Label -> Label_Type -> Void;
set_background: Label -> xc::Rgb -> Void;
set_foreground: Label -> xc::Rgb -> Void;
};
end;