[Sciviews-commits] r539 - in pkg/tcltk2: . man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Nov 30 15:30:33 CET 2013


Author: phgrosjean
Date: 2013-11-30 15:30:32 +0100 (Sat, 30 Nov 2013)
New Revision: 539

Modified:
   pkg/tcltk2/NAMESPACE
   pkg/tcltk2/NEWS
   pkg/tcltk2/man/tk2dialogs.Rd
Log:
Added tk2swaplist() to tcltk2

Modified: pkg/tcltk2/NAMESPACE
===================================================================
--- pkg/tcltk2/NAMESPACE	2013-11-30 13:04:02 UTC (rev 538)
+++ pkg/tcltk2/NAMESPACE	2013-11-30 14:30:32 UTC (rev 539)
@@ -61,6 +61,7 @@
        tk2theme.list,
        tk2theme,
        tk2chooseFont,
+       tk2swaplist,
        tk2edit,
        tk2dde,
        tk2dde.exec,

Modified: pkg/tcltk2/NEWS
===================================================================
--- pkg/tcltk2/NEWS	2013-11-30 13:04:02 UTC (rev 538)
+++ pkg/tcltk2/NEWS	2013-11-30 14:30:32 UTC (rev 539)
@@ -7,6 +7,8 @@
   very simple example is also added in the document. The widget is very rich,
   and you will have to figure out by yourself how to access all its command from
   its original documentation.
+  
+* A tk2swaplist() dialog box is added.
 
 
 == Version 1.2-6

Modified: pkg/tcltk2/man/tk2dialogs.Rd
===================================================================
--- pkg/tcltk2/man/tk2dialogs.Rd	2013-11-30 13:04:02 UTC (rev 538)
+++ pkg/tcltk2/man/tk2dialogs.Rd	2013-11-30 14:30:32 UTC (rev 539)
@@ -1,25 +1,33 @@
 \name{tk2dialogs}
 \alias{tk2chooseFont}
+\alias{tk2swaplist}
 
 \title{ Additional Tk dialog boxes  }
 \description{
-  Tk dialog boxes to select a font, a R color, etc.
+  Tk dialog boxes to select a font or a list of ordered items.
 }
 \usage{
-tk2chooseFont(...)
+tk2chooseFont(\dots)
+tk2swaplist(items, selection, title = "Select items", \dots)
 }
 
 \arguments{
+  \item{items}{ a vector of numbers, logicals, characters, factor or ordered. }
+  \item{selection}{ preselected items, in the right order. }
+  \item{title}{ title of the dialog box. }
   \item{\dots}{ further arguments passed to the dialog box. }
 }
 
 \value{
-  The selection made in the dialog box if \code{OK} is clicked, \code{""} otherwise.
+  The selection made in the dialog box if \code{OK} is clicked, \code{""}
+  otherwise for \code{tk2chooseFont()}, or an zero-length vector for
+  \code{tk2swaplist()}.
 }
 
 \author{ Philippe Grosjean }
 \note{ If you use tile 0.7.2 or above, these dialog boxes will automatically
-  use it. Otherwise, the dialog boxes will use plain Tk widgets }
+  use it. Otherwise, the dialog boxes will use plain Tk widgets (not yet for
+  \code{tk2swaplist()}). }
 
 \seealso{ \code{\link{tk2widgets}}, \code{\link{tk2commands}} }
 
@@ -27,11 +35,18 @@
 \dontrun{
 ## These cannot be run by examples() but should be OK when pasted
 ## into an interactive R session with the tcltk package loaded
+
 tk2chooseFont()
 tk2chooseFont(font = "{courier} 9", title = "Choose a fixed font",
     fonttype = "fixed", style = 4, sizetype = "all")
 tk2chooseFont(font = "Verdana 12 bold italic underline overstrike",
     fonttype = "prop", style = 2, sizetype = "point")
+
+tk2swaplist(1:10, 1:5) # integer
+tk2swaplist(as.numeric(1:10), 1:5) # double
+tk2swaplist(paste("V", 1:10), paste("V", 1:5)) # character
+tk2swaplist(as.factor(1:10), 1:5) # factor
+tk2swaplist(as.ordered(1:10), 1:5) # ordered
 }
 }
 



More information about the Sciviews-commits mailing list