NAME

labeledentry - A Dmhwidget for a labeled entryfield

SYNOPSIS

dmhwidgets::labeledentry pathName ?options?

INHERITANCE

itk::Widget <- dmhwidgets::Labeledentry

STANDARD OPTIONS

background cursor foreground font highlightcolor highlightthickness insertbackground insertborderwidth insertwidth insertontime insertofftime selectbackground selectborderwidth selectforeground show textvariable width

See the options manual entry for details on the standard options.

INHERITED OPTIONS

textvariable width show

See the entry manual entry for details.

labelfont labeltext labelvariable labelwidth

See the label manual entry for details.

WIDGET-SPECIFIC OPTIONS

Name: readonly  Class: Readonly  Command-Line Switch: -readonly  Default value: 0

The value is used as a boolean to determine if the entry should be disabled.

DESCRIPTION

The labeledentry command creates a widget that displays a label on the left of an entry, and a new Tcl command whose name is pathname. The command is then used to invoke various methods of the widget. The command has the general form:

pathName option ?arg arg ... arg?

The widget is far simpler but less flexible than the iwidgets::entryfield widget. A set of aligned fields is easily obtained by specifying a common value of -labelwidth and anchoring the labelentry items to the left.

WIDGET-SPECIFIC METHODS

None.

EXAMPLE

package require Dmhwidgets

global labeledentry
array set labeledentry {
  name {Harry Potter}
  cust_id {99567 (read-only)}
  addr1 {800 Massachusetts Ave}
  addr2 {Cambridge, MA 02139}
  }

# Use a common value of -labelwidth for alignment 

set ct 0
foreach rec {{Name: name} {Address1: addr1} {Address2: addr2}\
 {{Customer ID:} cust_id}} {
    foreach {prompt subscript} $rec {}
    dmhwidgets::labeledentry .labelentry$ct -labeltext $prompt -labelwidth 12\
 -textvariable labeledentry($subscript)
    pack .labelentry$ct -side top -fill x -anchor w -padx 12m -pady 1m
    if { $prompt == "Customer ID:" } {
        .labelentry$ct configure -readonly 1
        }
    incr ct
    }

AUTHOR

Hume Integration Software, www.hume.com

KEYWORDS

label, entry, forms, widget