widgetRender(tkWidgets)
widgetRender()所属R语言包:tkWidgets
Render a Tk Widget from Given Specifications
由于规格,呈现一个Tk部件
译者:生物统计家园网 机器人LoveR
描述----------Description----------
This function takes a list that specifies the appearance and behavior of a Tk widget and renders the widget accordingly.
这个函数接受一个列表指定一个Tk小部件的外观和行为,并呈现相应的部件。
用法----------Usage----------
widgetRender(iWidget, tkTitle)
参数----------Arguments----------
参数:iWidget
list of lists that specifies the appearance and behavior of the widget to be rendered.
列表列表,指定要呈现的构件的外观和行为。
参数:tkTitle
character string for the text to appear in the title bar of the widget to be rendered.
字符串的文字出现在标题栏要呈现的构件。
Details
详情----------Details----------
The widget to be rendered normally consists of frames with three widgets arranged in a row. The first widget is normally a label for the name of the second widget. The second widget can be any type of widgets. The third widget is a button widget that defines some behavior to be associated with the second widget. For example, a button that will cause something to be displayed in the second widget when pressed. The third widget can be missing if no such association is required.
通常要呈现的部件组成排成一排的三个部件的框架。第一个小部件通常是第二个部件的名称标签。第二个部件可以是任何类型的部件。第三个部件是一个按钮控件,定义一些相关的第二个部件的行为。例如,一个按钮,将导致一些被按下时显示在第二个部件。第三个部件可缺少是必需的,如果没有这样的协会。
The widget to be rendered also has two buttons at the bottom part of the widgets. The followings are the name and behavior of the buttons:
要呈现的部件也有两个按钮,在底部的部件。以下是按钮的名称和行为:
Cancel - The unmodified list passed to the function at
取消 - 未修改列表传递给函数
End - A modified version of the iWidget argument will be returned when pressed. The returned list has the same number of elements as the original one but with the values
按下时,将返回终结 - iWidget参数的修改后的版本。返回列表中有相同数量的元素,作为原始值之一,但
值----------Value----------
A list of lists with the original values of the passed modified or unmodified depending on whether the cancel or end button pressed.
一个list名单传递取决于是否取消或终止按钮修改或未经修改的原始值。
作者(S)----------Author(s)----------
Jianhua (John) Zhang
参考文献----------References----------
A Primer on the R-Tcl/Tk Package; R News 1 (3), 27–31 http://CRAN.R-project.org/doc/Rnews/
参见----------See Also----------
fileBrowser, objectBrowser.
fileBrowser,objectBrowser。
举例----------Examples----------
# Create the list to be passed[创建要传递的列表]
pW1 <- list(Name="AAA", Value="bbb",
toText=function(x) paste(x,collapse= ","), fromText=NULL,
canEdit=TRUE,
buttonFun = fileBrowser, buttonText = "Browse")
pW2 <- list(Name="BBB", Value="x,y,z",
toText=function(x) paste(x, collapse=","), fromText=NULL,
canEdit=TRUE, buttonFun = ls, buttonText = "List")
pW3 <- list(Name="CCC", Value="ccc",
toText=function(x) paste(x, collapse = ","), fromText=NULL,
canEdit=TRUE, buttonFun=NULL, buttonText=NULL)
widget1 <- list(wList = list(a = pW1, b = pW2, c = pW3),
preFun = function() "Hi",
postFun = function() "Bye")
# Call the function[调用函数]
if(interactive()){
x <- widgetRender(widget1, "Test Widget")
str(x)
}
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|