VtDrawnList object_name [options]
Creates a DrawnList widget. Returns the widget name.
This option has no effect in graphical mode.
Additional callback keys
*
AverageWidth pixels
wide, where AverageWidth is the average width of a character in the
current font set. Use the -columnWidth option with
VtSetAppValues
if the maximum character width of the font is needed instead. In
character mode, this option makes the DrawnList integer
columns wide.
Additional callback keys
For example:
VtDrawnList $main.list \ -iconList {apple.px orange.px banana.px} \ -formatList {{ICON 2} {STRING 20} {STRING 15}} \ -fieldList [list 1 "Orange" "Fruit"]
There are a number of pre-defined connection icons available for use with the -fieldList option.
{ type width [left_margin, right_margin] }
The left_margin and right_margin parameters are optional. The following specifies a column that is of type ICON, with a width of 1 icon width and a left_margin and right_margin of 5 pixels.
{ ICON 1 5 5 }
Valid types are ICON, STRING, and DATA. DATA does not display on the screen; it is used to store item-specific data.
For example:
-formatList { {ICON 3} {STRING 20 5} {DATA} }
The first column is an icon field with a width of 3, the second column contains a string with a width of 20 and a left margin of 5, and the third column contains hidden data.
-CHARM_iconList {a b c} -MOTIF_iconList {a.px b.px c.px}
In this example, graphical systems load the pixmaps
a.px
, b.px
, and c.px
. Character
systems load no pixmaps, but display instead the letters a, b, and c.
{ { 0 1 "Apple" "Fruit"} { 1 1 "Kumquat" "Fruit"} { 1 3 "Leek" "Vegetable"} }
There are a number of pre-defined connection icons available for use with the -recordList option.
For graphical mode:
For character mode:
If -selection BROWSE is specified, then in graphical mode the policy SINGLE will be used. If -selection EXTENDED is specified, then in graphical mode the policy MULTIPLE will be used. This can be overridden by explicitly setting CHARM_selection and MOTIF_selection.
For example:
VtDrawnListAddItem $main \ -formatList {{ICON 4} {STRING 20}} \ -recordList {{ CONNECT_H 0 NO_ICON NO_ICON "Apple" } \ { NO_ICON CONNECT_T 1 NO_ICON "Orange" } \ { NO_ICON CONNECT_T 2 NO_ICON "Kumquat"} \ { NO_ICON CONNECT_T 0 NO_ICON "Banana" } \ { NO_ICON CONNECT_I CONNECT_L 0 "Grape" } \ { NO_ICON CONNECT_L 0 NO_ICON "Pear" }}
This code produces the following:
The following code produces a DrawnList containing 3 labelled icons.
set app [VtOpen "VtDrawnList Demo"] set form [VtForm $app.form] set list [VtDrawnList $form.list -rows 3 \ -columns 25 \ -formatList {{ICON 1} {STRING 20}} -iconList { \ orange.px \ apple.px \ pear.px} \ -recordList { \ {0 " Orange"} \ {1 " Apple"} \ {2 " Pear" }}] VtShowDialog $app.form VtMainLoop
This code produces the following:
See also: