NAME
Label - a label widget with added dynamic help, drag and drop, and easy internationalization (i18n)
SYNOPSIS
Label pathName ?option value...?
DESCRIPTION
STANDARD OPTIONS
Not themed
-anchor
-background or -bg
-bitmap
-borderwidth or -bd
-cursor
-disabledforeground
-font
-foreground or -fg
-highlightbackground
-highlightcolor
-highlightthickness
-image
-justify
-padx
-pady
-relief
-takefocus
-text
-textvariable
-wraplength
Themed
-anchor
-background or -bg
-cursor
-font
-foreground or -fg
-image
-justify
-relief
-takefocus
-text
-textvariable
-wraplength
WIDGET-SPECIFIC OPTIONS
-dragenabled
-dragendcmd
-dragevent
-draginitcmd
-dragtype
-dropcmd
-dropenabled
-dropovercmd
-droptypes
-focus
-height
-helptext
-helptype
-helpvar
-name
-state
-underline
-width
WIDGET COMMAND
pathName cget option
pathName configure ?option? ?value option value ...?
pathName setfocus

NAME

Label - a label widget with added dynamic help, drag and drop, and easy internationalization (i18n)

SYNOPSIS

Label pathName ?option value...?

DESCRIPTION

The Label widget extends the default Tk label. Options have been added to provide visual effects depending on the state of the Label, DynamicHelp options, Drag and Drop, and the option -name for easy internationalization (i18n).

The Label widget is used in the Slab LabelFrame, and thus in LabelEntry, SelectFont, and PasswdDlg.

WIDGET-SPECIFIC OPTIONS

-dragenabled
(Boolean) if and only if true, then drag is enabled.
-dragendcmd
Specifies a command to be called when drag ends. -dragendcmd must be a command conforming to the description of the option -dragendcmd of DragSite::register.
-dragevent
Specifies the number of the mouse button associated with the drag. Must be 1, 2 or 3.
-draginitcmd
Specifies a command to be called when -dragevent occurs on widget. -draginitcmd must be a command conforming to the description of the option -draginitcmd of DragSite::register.

If -draginitcmd is empty, the internal -draginitcmd command is used instead and returns:
IMAGE {copy} <image name> if an image is displayed.
BITMAP {copy} <bitmap name> if a bitmap is displayed.
TEXT {copy} <text> if a text is displayed.
Note that if -dragtype option is not empty, its value is used instead of those above.
-dragtype
Specifies an alternate type of dragged object.
-dropcmd
Specifies a command to be called when drop occurs on the widget. -dropcmd must be a command conforming to the description of the option -dropcmd of DropSite::register.

If -dropcmd is empty, the command updates the Label following the type of the data:
COLOR or FGCOLOR reconfigure the -foreground of the Label.
BGCOLOR reconfigure the -background of the Label.
IMAGE reconfigure the Label to display the associated image.
BITMAP reconfigure the Label to display the associated bitmap. image option is set to empty.
TEXT, or any other tag reconfigure the Label to display the associated string. image and bitmap options are set to empty.
and returns 1.
-dropenabled
(Boolean) if and only if true, then drop is enabled.
-dropovercmd
Specifies a command to be called when drag icon is over the widget. -dropovercmd must be a command conforming to the description of the option -dropovercmd of DropSite::register.
If -dropovercmd is empty, Label always accepts the drop if data type is FGCOLOR, COLOR, BGCOLOR, and accepts all other data type only if -state is normal.
-droptypes
Specifies a list of accepted drop objects/operations. See option -droptypes of DropSite::register. for more information. Default accepts FGCOLOR, COLOR, BGCOLOR, TEXT, BITMAP and IMAGE, all with copy and move operations.
-focus
Specifies the Tk window path that will receive the focus if the setfocus widget command is called.
-height
Specifies a desired height for the Label. If an image or bitmap is being displayed in the Label (with or without text) then the value is in screen units; if the Label displays text only then the value is in lines of text. If this option is not specified, then the Label's desired height is computed from the size of the image/bitmap and/or text being displayed in it.
This option is not available for themed widgets.
-helptext
Text for dynamic help. If empty, no help is available for this widget. See also DynamicHelp.
-helptype
Type of dynamic help. Use balloon or variable. See also DynamicHelp.
-helpvar
Variable to use when -helptype option is variable. See also DynamicHelp.
-name
Specifies a name name for the Label. If the key nameName is found in the module Slab::lang::code where code identifies the msgcat locale, then the values for the -text and -underline options are obtained from the value assigned to that key by the module.
-state
Specifies one of two states for the Label: normal or disabled. In normal state the text of the Label is displayed using the -foreground option. In disabled state the text of the Label is displayed using the -disabledforeground option.
-underline
Specifies the integer index of a character to underline in the Label. 0 corresponds to the first character of the text displayed, 1 to the next character, and so on. A value of -1 in Tk 8, or {} in Tk 9, indicates that no character is underlined.
The binding <Alt-char> is automatically set on the toplevel of the Label to call the setfocus widget command.
-width
Specifies a desired width for the Label. If an image or bitmap is being displayed in the Label (with or without text) then the value is in screen units, if the Label displays text only then the value is in characters. If this option is not specified, the Label's desired width is computed from the size of the image/bitmap and/or text being displayed in it.

WIDGET COMMAND

pathName cget option
Returns the current value of the configuration option given by option. The argument option may have any of the values accepted by the creation command Label.
pathName configure ?option? ?value option value ...?
Query or modify the configuration options of the widget. If no option is specified, returns a list describing all of the available options for pathName. If option is specified with no value, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no option is specified). If one or more option-value pairs are specified, then the command modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. Argument option may have any of the values accepted by the creation command Label. Read-only options cannot be modified.
pathName setfocus
Sets the focus to another window defined by option -focus; but only if that window exists and passes the Slab::Widget::focusOK test, and only if the Label's value of -state is normal.
Copyright © 1998-1999 UNIFIX.
Copyright © 2001-2002 ActiveState Corp.
Copyright © 2017-2025 CitizenEarth Internet Ltd.