DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

VtDrawnListAddItem(1vtcl)


VtDrawnListAddItem -- add an item to a DrawnList

Synopsis

VtDrawnListAddItem drawnlist_widgetName [options]

Description

Adds an item to the DrawnList. If you do not specify a position VtDrawnListAddItem will append it to the end of the list.

Options


-fieldList list (C)
Sets a row of data for the DrawnList. The default formatting is used on the list if you do not specify -formatList in the command.

For example:

   ...
   -formatList {{ICON 2} {STRING 20} {STRING 15}}  \
   -fieldList  [list 1 "John Doe" "555-1212"]
   ...

-formatList list (CS)
Describes the columns used in the DrawnList. This field contains a list of column descriptions. Each column description in turn is a list containing the column type, the column width, and the column's left and right margins. The syntax is:
{ TYPE WIDTH [Left_Margin, Right_Margin] }
The left and right margins are optional parameters. The following specifies a column that is of type ICON, with a width of 1 icon width and a left and right margin of 5 pixels:
{ ICON 1 5 5 }
Valid types are ICON, STRING, and DATA. DATA is not displayed on the screen; it is used to store item specific data.

An example of a formatList is:

-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, the third column contains hidden data.

-itemBorder NONE | ONOFFD.NM | DOUBLED.NM | SOLID (CS)
Used to set a border around a DrawnList item. This option only applies to the graphical environment.

-overrideFont string (CS)
Sets the font of the DrawnList item to one of the symbolic font names defined in the SCO Visual Tcl application resource file. Pre-defined symbols are:
smallPlainFont
smallBoldFont
smallItalicFont
medPlainFont
medBoldFont
medItalicFont
largePlainFont
largeBoldFont
largeItalicFont
monoNormalFont
monoBoldFont
monoItalicFont
This option only applies to the graphical environment.

-position integer (NA)
Specifies the position of the item to add to the DrawnList. (The base position is 1. To indicate the last item on the list, use 0.)

-recordList list_of_lists (C)
Sets one or more rows of data.
{ { 0 1 "field one" "field two"}
  { 1 1 "field one" "field two"}
  { 1 3 "field one" "field two"}
}
When specifying an icon index in -fieldList or -recordList the following indexes can be used to reference connection icons or no icons:

CONNECT_L
CONNECT_I
CONNECT_T
NO_ICON

For example:

...
VtDrawnListAddItem $lst \
    -formatList {{ICON 5} {STRING 20 5}} \
    -fieldList {"CONNECT_I NO_ICON 1 CONNECT_H  2" "Multiple icons" }

You must specify either -fieldList or -recordList, but not both.

Return values

If VtDrawnListAddItem fails, it returns one of the following error messages:

DRAWNLIST_BORDER
border is of an unknown type

FIELD_DESCRIPTION
error in field description

NOT_DRAWNLIST
referenced widget is not a DrawnList

RECORD_AND_FIELD
either -fieldList or -recordList must be set, not both

RECORD_OR_FIELD
either -fieldList or -recordList must be set

Standard errors
See ``Tcl widget creation errors'' in Developing Visual Tcl applications.

25 April 2004
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004