PtLabel
PtLabel — A label that displays text, bitmaps, or images.
Synopsis
class PtLabel PtBasic
{
accel_key; // string (Pt_ARG_ACCEL_KEY)
balloon_color; // color (Pt_ARG_BALLOON_COLOR)
balloon_fill_color; // color (Pt_ARG_BALLOON_FILL_COLOR)
balloon_position; // short (Pt_ARG_BALLOON_POSITION)
horizontal_alignment; // unsigned char (Pt_ARG_HORIZONTAL_ALIGNMENT)
label_data; // PhImage (Pt_ARG_LABEL_DATA)
label_flags; // flag (Pt_ARG_LABEL_FLAGS)
label_type; // char (Pt_ARG_LABEL_TYPE)
line_spacing; // unsigned short (Pt_ARG_LINE_SPACING)
margin_bottom; // unsigned short (Pt_ARG_MARGIN_BOTTOM)
margin_left; // unsigned short (Pt_ARG_MARGIN_LEFT)
margin_right; // unsigned short (Pt_ARG_MARGIN_RIGHT)
margin_top; // unsigned short (Pt_ARG_MARGIN_TOP)
select_shift; // unsigned short (Pt_ARG_SELECT_SHIFT)
text_font; // string (Pt_ARG_TEXT_FONT)
text_string; // string (Pt_ARG_TEXT_STRING)
underline1; // color (Pt_ARG_UNDERLINE1)
underline2; // color (Pt_ARG_UNDERLINE2)
underline_type; // unsigned short (Pt_ARG_UNDERLINE_TYPE)
vertical_alignment; // unsigned char (Pt_ARG_VERTICAL_ALIGNMENT)
}
Description
This widget is a label that
can hold text, bitmaps, or images, and has an optional pop-up
text balloon. Labels can be used to identify widgets and data
entry fields, make icons, or put pictures into your
applications.
![[Note]](images/note.gif) | For detailed information, please refer to PtLabel
in the Photon documentation.
|
Instance Variables
- accel_key
- A string specifying a character to use as an
accelerator key or hot key.
- balloon_color
- A number specifying the color for pop-up balloon text.
Default is 0x0 (black).
- balloon_fill_color
- A number specifying the color for the pop-up balloon
background. Default is 0xfeffb1
(yellow).
- balloon_position
This instance variable specifies
the position of the pop-up balloon, and may have one
of the following values:
- horizontal_alignment
This instance variable specifies
the horizontal alignment of the label text, and may
have one of the following values:
- label_data
- A PhImage displayed
by the label if the label_type
is set to Pt_IMAGE.
- label_flags
This instance variable controls
the appearance and behavior of the widget, and may be
a combination of zero or more of the following
flags:
- label_type
This instance variable specifies
the type of label, and may have one of the following
values:
- line_spacing
- A number of pixels to put
between lines of text for extra space.
- margin_bottom,
margin_left,
margin_right,
margin_top
- A number of pixels on the bottom, left, right,
and top between the text and the edge of the label for
margins.
- select_shift
- This instance variable is deprecated. Set the
Pt_LABEL_SELECT_SHIFT flag in
label_flags instead.
- text_font
- A string specifying the font used for label
text.
- text_string
- The string used for the label text string if the
label_type is set to
Pt_Z_STRING or
Pt_TEXT_IMAGE.
- underline1
- A number specifying the color for the first underline.
Default is 0x0 (black).
- underline2
- A number specifying the color for the second underline,
which is just below the first underline. Making the two the
same color creates a thick underline. Default is
0xffffffff (transparent).
- underline_type
A constant that specifies the type of
underline for the text. For single or double
underlines, the underline colors are specified using
underline1 and
underline2 (above). Etched
underlines use the colors of the widget's
top_border_color and
bot_border_color.
This instance variable may have one of the
following values:
- vertical_alignment
This instance variable determines
the vertical alignment of the text string, and may
have one of the following values: