stringItem: A string item

Description Usage Arguments Value See Also Examples

Description

A string item

Usage

1
2
stringItem(value = "", regex = NULL, name, label = name, help = "",
  tooltip = "", eval_first = FALSE, attr, model, editor, ...)

Arguments

value

Default value for the model

regex

If non NULL specifies a regular expression for validation.

name

Required name for object. Names should be unique within a group of items

label

Optional label, default value is the name

help

Optional help string

tooltip

Optional tooltip to display

eval_first

Should value be run through eval/parse before coercion.

attr

A list of attributes to pass to widget on construction. Eg. attr=list(size=c(100,200))

model

Optional model. Useful if one wishes to use same model for multiple views

editor

Specification of editor (a view) to override default

...

Passed to parent proto object during call to proto

Value

A proto object. Call obj\$show_help() to view its methods and properties.

See Also

Item

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## basic usage
a <- stringItem("ac", name="x")
a$get_x()
a$set_x("abc213")
a$get_x()
## eval first
a <- stringItem("ac", name="x", eval_first=TRUE)
a$set_x("2 + 2")
a$get_x()
a$to_R()

traitr documentation built on May 2, 2019, 3:32 p.m.