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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Nov 30 14:04:02 CET 2013


Author: phgrosjean
Date: 2013-11-30 14:04:02 +0100 (Sat, 30 Nov 2013)
New Revision: 538

Modified:
   pkg/tcltk2/DESCRIPTION
   pkg/tcltk2/NAMESPACE
   pkg/tcltk2/NEWS
   pkg/tcltk2/R/tk2widgets.R
   pkg/tcltk2/man/tcltk2-package.Rd
   pkg/tcltk2/man/tk2widgets.Rd
Log:
Added tk2tablelist() + example to tcltk2

Modified: pkg/tcltk2/DESCRIPTION
===================================================================
--- pkg/tcltk2/DESCRIPTION	2013-11-30 10:59:13 UTC (rev 537)
+++ pkg/tcltk2/DESCRIPTION	2013-11-30 13:04:02 UTC (rev 538)
@@ -1,7 +1,7 @@
 Package: tcltk2
 Type: Package
-Version: 1.2-6
-Date: 2013-11-29
+Version: 1.2-7
+Date: 2013-11-30
 Title: Tcl/Tk Additions
 Authors at R: c(person("Philippe", "Grosjean", role = c("aut", "cre"),
   email = "phgrosjean at sciviews.org"))

Modified: pkg/tcltk2/NAMESPACE
===================================================================
--- pkg/tcltk2/NAMESPACE	2013-11-30 10:59:13 UTC (rev 537)
+++ pkg/tcltk2/NAMESPACE	2013-11-30 13:04:02 UTC (rev 538)
@@ -37,6 +37,7 @@
        tk2separator,
        tk2spinbox,
        tk2table,
+       tk2tablelist,
        tk2text,
        tk2ctext,
        tk2tree,

Modified: pkg/tcltk2/NEWS
===================================================================
--- pkg/tcltk2/NEWS	2013-11-30 10:59:13 UTC (rev 537)
+++ pkg/tcltk2/NEWS	2013-11-30 13:04:02 UTC (rev 538)
@@ -1,5 +1,14 @@
 = tcltk2 news
 
+== Version 1.2-7
+
+* A tk2tablelist() function added to create a tablelist widget (the Tcl package
+  was distributed with tcltk2, but no convenient widget creator provided). A
+  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.
+
+
 == Version 1.2-6
 
 * No additional ttk themes are loaded on startup any more. The required

Modified: pkg/tcltk2/R/tk2widgets.R
===================================================================
--- pkg/tcltk2/R/tk2widgets.R	2013-11-30 10:59:13 UTC (rev 537)
+++ pkg/tcltk2/R/tk2widgets.R	2013-11-30 13:04:02 UTC (rev 538)
@@ -361,6 +361,19 @@
 	} else stop("Tcl package 'Tktable' must be installed first")
 }
 
+tk2tablelist <- function (parent, ...) 
+{
+    if (!is.ttk()) 
+        stop("Tcl/Tk >= 8.5 is required")
+    if (inherits(tclRequire("tablelist_tile", warn = FALSE), "tclObj")) {
+        w <- tkwidget(parent, "tablelist::tablelist", font = "TkDefaultFont", 
+            ...)
+        class(w) <- c("tk2tablelist", "tk2widget", class(w))
+        return(w)
+    }
+    else stop("Tcl package 'tablelist' must be installed first")
+}
+
 tk2text <- function (parent, tip = "", ...)
 {
 ### TODO: autohide scrollbars

Modified: pkg/tcltk2/man/tcltk2-package.Rd
===================================================================
--- pkg/tcltk2/man/tcltk2-package.Rd	2013-11-30 10:59:13 UTC (rev 537)
+++ pkg/tcltk2/man/tcltk2-package.Rd	2013-11-30 13:04:02 UTC (rev 538)
@@ -16,8 +16,8 @@
 \tabular{ll}{
 Package: \tab tcltk2\cr
 Type: \tab Package\cr
-Version: \tab 1.2-6\cr
-Date: \tab 2013-11-29\cr
+Version: \tab 1.2-7\cr
+Date: \tab 2013-11-30\cr
 License: \tab LGPL-3 plus see LICENSE file\cr
 LazyLoad: \tab yes\cr
 }

Modified: pkg/tcltk2/man/tk2widgets.Rd
===================================================================
--- pkg/tcltk2/man/tk2widgets.Rd	2013-11-30 10:59:13 UTC (rev 537)
+++ pkg/tcltk2/man/tk2widgets.Rd	2013-11-30 13:04:02 UTC (rev 538)
@@ -22,6 +22,7 @@
 \alias{tk2separator}
 \alias{tk2spinbox}
 \alias{tk2table}
+\alias{tk2tablelist}
 \alias{tk2text}
 \alias{tk2ctext}
 \alias{tk2tree}
@@ -56,6 +57,7 @@
 tk2separator(parent, orientation = c("horizontal", "vertical"), \dots)
 tk2spinbox(parent, tip = "", \dots)
 tk2table(parent, \dots)
+tk2tablelist(parent, \dots)
 tk2text(parent, tip = "", \dots)
 tk2ctext(parent, tip = "", \dots)
 tk2tree(parent, tip = "", \dots)
@@ -195,6 +197,16 @@
 table1 <- tk2table(tt2, variable = "tclarray", rows = "3", cols = "2",
     titlerows = "1", selectmode = "extended", colwidth = "25", background = "white")
 tkpack(table1)
+
+## A tablelist example
+tt <- tktoplevel()
+tlist <- tk2tablelist(tt, columntitles = c("First column", "Second column"),
+    stretch = "all", expand = 1)
+tkpack(tlist, fill = "both")
+tkinsert(tlist, "end", c("first row", "another value"))
+tkinsert(tlist, "end", c("another row", "bla bla"))
+tbut <- tk2button(tt, text = "Done", command = function () tkdestroy(tt))
+tkpack(tbut)
 }
 }
 



More information about the Sciviews-commits mailing list