rp.text | R Documentation |
This function adds one or more boxes which allow text to be entered.
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)
panel |
the panel on which the text should appear. |
text |
the text to be displayed |
pos |
the layout instructions. Please see the |
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 |
... |
... |
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.
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.
rpanel: Simple interactive controls for R functions using the tcltk package. Journal of Statistical Software, 17, issue 9.
rp.control
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.