writeText: Functions that read from and write to tcltk widgets

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/tkUtil.R

Description

These functions provide some of the common read and write operations for tcltk widgets

Usage

1
2
3
4
5

Arguments

widget

widget a tkwin object for the tcltk widget to be read or written to

value

value the text of numerical value to be written to a tcltk widget

clear

clear a boolean to indicate whether a value will append to the existing one (FALSE)

which

which a tkwin object for the tcltk widget whose value will be retrieved

Details

writeText writes to a given tcltk text box widget.

writeList writes to a given tcltk list or entry box widget.

getListValue retrieves the selected value in a tcltk list widget.

getTextValue retrieves the value of a text box.

getEntryValue retrieves the value of an entry box.

Value

getListValue returns the selected value in a tcltk list widget.

getTextValue returns the value of a text box.

getEntryValue returns the value of an entry box.

Author(s)

Jianhua Zhang

References

R tcltk

See Also

basicPW-class, widget-class

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## Not run: 
    ## These cannot be run by examples() but should be OK when pasted
    ## into an interactive R session with the widgetTools package loaded

    # Create the widgets
    base <- tktoplevel()
    list <- tklistbox(base, width = 20, height = 5)

    entry <- tkentry(base)
    text <- tktext(base, width = 20, height = 5)
    tkpack(list, entry, text)
    # Write and read from the widgets
    writeList(list, c("Option1", "Option2", "Option3"))
    writeList(entry, "An Entry box")
    writeText(text, "A text box")
    # Will be NULL if not selected
    getListValue(list)
    getTextValue(text)
    getEntryValue(entry)
# Destroy toplevel widget
#    tkdestroy(base)

## End(Not run)

widgetTools documentation built on Nov. 8, 2020, 8:29 p.m.