IUP::Label - [GUI element] displays a separator, a text or an image
Creates a label interface element, which displays a separator, a text or an image.
CREATION - new() method
$label = IUP::Label->new( TITLE=>"Text" );
Returns: the identifier of the created element, or
undef if an error occurs.
NOTE: You can pass to
CALLBACKNAME=>\&func pairs relevant to this element - see IUP::Manual::02_Elements.
For more info about concept of attributes (setting/getting values etc.) see IUP::Manual::03_Attributes. Attributes specific to this element:
The only difference between an active label and an inactive one is its visual feedback. Possible values: "YES, "NO". Default: "YES".
Horizontal and vertical alignment. Possible values: "ALEFT", "ACENTER" and "ARIGHT", combined to "ATOP", "ACENTER" and "ABOTTOM". Default: "ALEFT:ACENTER". Partial values are also accepted, like "ARIGHT" or ":ATOP", the other value will be used from the current alignment. In Motif, vertical alignment is restricted to "ACENTER". (vertical alignment since iup-3.0)
Ignored, transparent in all systems. Will use the background color of the native parent.
[Windows and GTK only]
Add an ellipsis: "..." to the text if there is not enough space to render the entire string. Can be "YES" or "NO". Default: "NO". (GTK 2.6)
Text color. Default: the global attribute DLGFGCOLOR.
Image name or IUP::Image reference. If set before map defines the behavior of the label to contain an image. The natural size will be size of the image in pixels.
IMINACTIVE (non inheritable) [GTK and Motif only]
Image name of the element when inactive. If it is not defined then the IMAGE is used and the colors will be replaced by a modified version of the background color creating the disabled effect. GTK will also change the inactive image to look like other inactive objects.
Allows the title string to contains pango markup commands. Works only if a mnemonic is NOT defined in the title. Can be "YES" or "NO". Default: "NO".
Internal margin. Works just like the MARGIN attribute of the IUP::Hbox and <IUP::Vbox> containers, but uses a different name to avoid inheritance problems. Not used when SEPARATOR is used. Default value: "0x0".
(creation only, non inheritable)
Turns the label into a line separator. Possible values: "HORIZONTAL" or "VERTICAL". When changed before mapping the EXPAND attribute is set to "HORIZONTAL" or "VERTICAL" accordingly.
Label's text. If SEPARATOR or IMAGE are not defined before map, then the default behavior is to contain a text. The label behavior can not be changed after map. The natural size will be larger enough to include all the text in the selected font, even using multiple lines. The '\n' character is accepted for line change. The "&" character can be used to define a mnemonic, the next character will be used as key. Use "&&" to show the "&" character instead of defining a mnemonic. The next control from the label will be activated from any control in the dialog using the "Alt+key" combination. (mnemonic support since iup-3.0)
[Windows and GTK only]
Enables or disable the wrapping of lines that does not fits in the label. Can be "YES" or "NO". Default: "NO". Can only set WORDWRAP=YES if ALIGNMENT=ALEFT.
The following common attributes are also accepted:
For more info about concept of callbacks (setting callback handlers etc.) see IUP::Manual::04_Callbacks. Callbacks specific to this element:
Action generated when any mouse button is pressed or released. (since iup-3.3)
[Windows and GTK Only]
Action generated when one or more files are dropped in the element. (since iup-3.3)
The following common callbacks are also accepted:
Labels with images, texts or line separator can not change its behavior after mapped. But after map the image can be changed for another image, and the text for another text.
The element IUP::Label is used in the following sample scripts:
0-basic/canvas2.pl - IUP::Canvas example
0-basic/cbox.pl - IUP::Cbox example
0-basic/dial.pl - IUP::Dial example
0-basic/dialog1.pl - IUP::Dialog example
0-basic/frame1.pl - IUP::Frame Example
0-basic/gridbox.pl - IUP::GridBox example
0-basic/idle.pl - IUP->SetIdle Example
0-basic/image.pl - IUP::Image example
0-basic/label.pl - IUP::Label and IUP::Link example
0-basic/layoutdialog.pl - IUP::LayoutDialog example
0-basic/list2.pl - IUP::List example
0-basic/plot_advanced.pl - Plot controls
0-basic/sbox1.pl - IUP::Sbox example
0-basic/sbox2.pl - IUP::Sbox example
0-basic/tabs1.pl - IUP::Tabs example
0-basic/tabs3.pl - IUP::Tabs example
0-basic/text_format.pl - IUP::Text (formating) example
0-basic/timer.pl - IUP::Timer example
0-basic/tray.pl - IUP::Dialog + TRAY / TRAYTIP / TRAYIMAGE example
0-basic/tree_set_attrs.pl - IUP::Tree example (attributes)
0-basic/val.pl - IUP::Val example
0-basic/zbox.pl - IUP::Zbox example
1-apps/app-mdi.pl - IUP app example
1-apps/app-plot-demo.pl - dials for zooming
1-apps/app-sample1.pl - example used for screenshot - IUP.pod
1-apps/app-sample2.pl - example based on the original sample.c
1-apps/app-simple-demo.pl - example used for screenshot - IUP.pod
The original doc: iuplabel.html