Text boxes for a panel

Share:

Description

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

Usage

1
2
3
4
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

...

...

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.

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.

References

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

See Also

rp.control

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## 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")

## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.