rpanel (version 1.1-4)

rp.text: Text boxes for a panel

Description

This function adds one or more boxes which allow text to be entered.

Usage

rp.text(panel, text, pos=NULL, action=I, foreground=NULL, background=NULL,
        font=NULL, width=NULL, parentname=deparse(substitute(panel)),
        name = paste("text", .nc(), sep=""), ...)   
rp.text.change(panel, name, text)

Arguments

panel

the panel on which the text should appear.

text

the text to be displayed

pos

the layout instructions. Please see the rp.pos example and help for full details.

action

the function which is called when the text has been entered.

foreground

colour of the text

background

colour of the text background

font

font to be used

width

character width of the textboxes

parentname

this specifies the widget inside which the text entry widget should appear.

name

name assigned to the textentries; used for disposal etc

...

...

Warning

The action function should return the panel. Without this assignment any widgets added or alterations made to panel parameters within the action function will be lost.

Details

The function action should take one argument, which should be the panel to which the text box is attached.

See rp.grid for details of the grid layout system.

References

rpanel: Simple interactive controls for R functions using the tcltk package. Journal of Statistical Software, 17, issue 9.

See Also

rp.control

Examples

Run this code
# NOT RUN {
panel <- rp.control(x=1)
callback <- function(panel)
{
  rp.text.change(panel, "t2", panel$x)
  panel$x = panel$x+1
  panel
}
rp.text(panel, "This is a test", name="t1")
rp.text(panel ,"And so is this", font="Arial", foreground="white",
        background="navy", action=callback, name="t2")
rp.text(panel,"Here is some more text, this time across several lines.\n
               Here is some more text, this time across several lines.\n
               Here is some more text, this time across several lines.", name="t3")
# }

Run the code above in your browser using DataCamp Workspace