rp.button(rpanel)
rp.button()所属R语言包:rpanel
Button widget for rpanel
按钮部件rpanel
译者:生物统计家园网 机器人LoveR
描述----------Description----------
This function adds a button to the panel. A nominated function is called when the button is pressed.
此功能的按钮添加到面板上。获提名的函数被调用时,按下该按钮。
用法----------Usage----------
rp.button(panel, action, title = deparse(substitute(action)), id = "", parent = window, repeatdelay = 0, repeatinterval = 0, quitbutton = FALSE, pos = NULL, ...)
参数----------Arguments----------
参数:panel
the panel in which the button should appear. This may be passed as a panelname string or the panel object itself.
面板上的按钮应该出现。这可能是通过作为一个panelname的字符串或面板对象本身。
参数:action
the function executed when the button is pressed.
执行的功能的按钮被按下时。
参数:title
the text displayed on the button.
显示在按钮上的文本。
参数:id
the name of the button. This is helpful in allowing possible modification and layout changes which have not been implemented and will be considered later.
的按钮的名称。这是可能的修改和布局变化,都没有得到执行,将被视为允许。
参数:parent
this specifies the widget inside which the button should appear. In the current version of rpanel, it should not normally be used.
指定小工具里面的按钮应该出现。在的当前版本rpanel,通常不应使用。
参数:repeatinterval
the interval between auto-repeats (milliseconds) when the button is held down.
按住按钮时,自动重复(毫秒)之间的时间间隔。
参数:repeatdelay
the time after which the button starts to auto-repeat (milliseconds).
按钮开始自动重复(毫秒)的时间。
参数:quitbutton
this defaults to FALSE. Set to TRUE this creates a button which will close the window and escape from a rp.block call. Before the window is destroyed the action function will be called.
此默认为false。这将创建一个按钮,将关闭该窗口,逃避从rp.block调用设置为TRUE。窗口被销毁之前的操作函数将被调用。
参数:pos
the layout instructions. Please see the rp.pos example and help for full details.
布局说明。请看看rp.pos榜样和帮助的完整细节。
参数:...
information for pos can be passed individually as additional arguments.
pos的信息可以通过单独作为附加参数。
Details
详细信息----------Details----------
The function action should take one argument, which should be the panel. See rp.grid for details of the grid layout system.
函数action应该接受一个参数,它应该是面板。见rp.grid的网格布局系统的详细信息。
值----------Value----------
If the parameter panel is the panelname string the same string is returned. If the panel object is used the altered panel is assigned to both the calling level and panel's environment level.
如果该参数面板是panelname的的字符串相同的字符串返回。如果面板对象是用来改变的面板被分配到的层次和面板的环境。
警告----------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.
action函数应该返回面板。如果没有这个任务,任何部件或内action功能面板参数的改变将会丢失。
参考文献----------References----------
rpanel: Simple interactive controls for R functions using the tcltk package. Journal of Statistical Software, 17, issue 9.
参见----------See Also----------
rp.doublebutton,rp.control
rp.doublebutton,rp.control
实例----------Examples----------
if (interactive()) {
# This function will be called on pressing the button "Simulate".[此功能会被要求按下按钮“模拟”。]
boxp.sim <- function(panel) {
boxplot(rnorm(50))
panel
}
# Create an rpanel and add the button "Simulate" to it.[创建一个rpanel,并添加“模拟”按钮。]
panel <- rp.control()
rp.button(panel, action = boxp.sim, title = "Simulate")
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|