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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue May 1 23:16:47 CEST 2012


Author: phgrosjean
Date: 2012-05-01 23:16:47 +0200 (Tue, 01 May 2012)
New Revision: 479

Modified:
   pkg/tcltk2/DESCRIPTION
   pkg/tcltk2/NEWS
   pkg/tcltk2/R/tcltk2-Internal.R
   pkg/tcltk2/man/tcltk2-package.Rd
   pkg/tcltk2/test.R
Log:
tcltk2 version 1.2-3

Modified: pkg/tcltk2/DESCRIPTION
===================================================================
--- pkg/tcltk2/DESCRIPTION	2012-05-01 21:16:25 UTC (rev 478)
+++ pkg/tcltk2/DESCRIPTION	2012-05-01 21:16:47 UTC (rev 479)
@@ -1,7 +1,7 @@
 Package: tcltk2
 Type: Package
-Version: 1.2-2
-Date: 2012-04-28
+Version: 1.2-3
+Date: 2012-05-01
 Title: Tcl/Tk Additions
 Authors at R: c(person("Philippe", "Grosjean", role = c("aut", "cre"),
   email = "phgrosjean at sciviews.org"))

Modified: pkg/tcltk2/NEWS
===================================================================
--- pkg/tcltk2/NEWS	2012-05-01 21:16:25 UTC (rev 478)
+++ pkg/tcltk2/NEWS	2012-05-01 21:16:47 UTC (rev 479)
@@ -1,5 +1,10 @@
 = tcltk2 news
 
+== Version 1.2-3
+
+* The Tk configuration sequence in .onLoad() is changed. 
+
+
 == Version 1.2-2
 
 * For some reasons, version 1.2-1 on CRAN looks like version 1.2-0 on R-Forge.

Modified: pkg/tcltk2/R/tcltk2-Internal.R
===================================================================
--- pkg/tcltk2/R/tcltk2-Internal.R	2012-05-01 21:16:25 UTC (rev 478)
+++ pkg/tcltk2/R/tcltk2-Internal.R	2012-05-01 21:16:47 UTC (rev 479)
@@ -76,6 +76,52 @@
 				}
 			}')
 		}
+		
+		## Load additional ttk themes
+		try(tclRequire("ttk::theme::plastik"), silent = TRUE)
+		try(tclRequire("ttk::theme::keramik"), silent = TRUE)
+		try(tclRequire("ttk::theme::keramik_alt"), silent = TRUE)
+		try(tclRequire("ttk::theme::clearlooks"), silent = TRUE)
+		try(tclRequire("ttk::theme::radiance"), silent = TRUE)
+		
+		## Which ttk theme should we use?
+		## If the user specified a default theme, use it
+		if (!.loadTheme()) {
+			## ...otherwise, try to guess the best default value
+			themes <- try(tk2theme.list(), silent = TRUE)
+			if (!inherits(themes, "try-error")) {
+				if ("aqua" %in% themes) { # This must be aquaTk on a Mac
+					try(tk2theme("aqua"), silent = TRUE)
+				} else if ("vista" %in% themes) { # This must be Vista or Win 7
+					try(tk2theme("vista"), silent = TRUE)
+				} else if ("xpnative" %in% themes) { # This must be XP
+					try(tk2theme("xpnative"), silent = TRUE)
+				} else if ("winnative" %in% themes) { # This must be a pre-XP windows
+					try(tk2theme("winnative"), silent = TRUE)
+				} else if (.isUbuntu() && "radiance" %in% themes) {
+					try(tk2theme("radiance"), silent = TRUE)
+					## Special treatment for Ubuntu: change fonts to Ubuntu and Ubuntu mono
+					## and use white text on black for tooltips
+					tkfont.configure("TkDefaultFont", family = "Ubuntu", size = 11)
+					tkfont.configure("TkMenuFont", family = "Ubuntu", size = 11)
+					tkfont.configure("TkCaptionFont", family = "Ubuntu", size = 10)
+					tkfont.configure("TkSmallCaptionFont", family = "Ubuntu", size = 9)
+					tkfont.configure("TkTooltipFont", family = "Ubuntu", size = 9)
+					tkfont.configure("TkMenuFont", family = "Ubuntu", size = 11)
+					tkfont.configure("TkHeadingFont", family = "Ubuntu", size = 12)
+					tkfont.configure("TkIconFont", family = "Ubuntu", size = 11)
+					tkfont.configure("TkTextFont", family = "Ubuntu", size = 11)
+					tkfont.configure("TkFixedFont", family = "Ubuntu Mono", size = 11)
+					res <- tclRequire("tooltip")
+					if (inherits(res, "tclObj")) {
+						.Tcl(paste("set ::tooltip::labelOpts [list -highlightthickness 0",
+							"-relief solid -bd 1 -background black -fg white]"))
+					}
+				} else { # A modern "default" theme that fit not too bad in many situations
+					try(tk2theme("clearlooks"), silent = TRUE)
+				}
+			}
+		}		
 	}
 	
 	## Windows only
@@ -91,53 +137,6 @@
 		## Also register the DDE server as TclEval|R
         tk2dde("R")
     }
-	
-	## Load additional ttk themes
-	try(tclRequire("ttk::theme::plastik"), silent = TRUE)
-	try(tclRequire("ttk::theme::keramik"), silent = TRUE)
-	try(tclRequire("ttk::theme::keramik_alt"), silent = TRUE)
-	try(tclRequire("ttk::theme::clearlooks"), silent = TRUE)
-	try(tclRequire("ttk::theme::radiance"), silent = TRUE)
-	
-	## Which ttk theme should we use?
-	## If the user specified a default theme, use it
-	isUbuntu <- .isUbuntu()
-	if (!.loadTheme()) {
-		## ...otherwise, try to guess the best default value
-		themes <- tk2theme.list()
-		if ("aqua" %in% themes) { # This must be aquaTk on a Mac
-			try(tk2theme("aqua"), silent = TRUE)
-		} else if ("vista" %in% themes) { # This must be Vista or Win 7
-			try(tk2theme("vista"), silent = TRUE)
-		} else if ("xpnative" %in% themes) { # This must be XP
-			try(tk2theme("xpnative"), silent = TRUE)
-		} else if ("winnative" %in% themes) { # This must be a pre-XP windows
-			try(tk2theme("winnative"), silent = TRUE)
-		} else if (isUbuntu) {
-			try(tk2theme("radiance"), silent = TRUE)
-		} else { # A modern "default" theme that fit not too bad in many situations
-			try(tk2theme("clearlooks"), silent = TRUE)
-		}
-	}
-	## Special treatment for Ubuntu: change fonts to Ubuntu and Ubuntu mono
-	## and use white text on black for tooltips
-	if (isUbuntu && is.tk()) {
-		tkfont.configure("TkDefaultFont", family = "Ubuntu", size = 11)
-		tkfont.configure("TkMenuFont", family = "Ubuntu", size = 11)
-		tkfont.configure("TkCaptionFont", family = "Ubuntu", size = 10)
-		tkfont.configure("TkSmallCaptionFont", family = "Ubuntu", size = 9)
-		tkfont.configure("TkTooltipFont", family = "Ubuntu", size = 9)
-		tkfont.configure("TkMenuFont", family = "Ubuntu", size = 11)
-		tkfont.configure("TkHeadingFont", family = "Ubuntu", size = 12)
-		tkfont.configure("TkIconFont", family = "Ubuntu", size = 11)
-		tkfont.configure("TkTextFont", family = "Ubuntu", size = 11)
-		tkfont.configure("TkFixedFont", family = "Ubuntu Mono", size = 11)
-		res <- tclRequire("tooltip")
-		if (inherits(res, "tclObj")) {
-			.Tcl(paste("set ::tooltip::labelOpts [list -highlightthickness 0",
-				"-relief solid -bd 1 -background black -fg white]"))
-		}
-	}
 }
 
 .Last.lib <- function (libpath)

Modified: pkg/tcltk2/man/tcltk2-package.Rd
===================================================================
--- pkg/tcltk2/man/tcltk2-package.Rd	2012-05-01 21:16:25 UTC (rev 478)
+++ pkg/tcltk2/man/tcltk2-package.Rd	2012-05-01 21:16:47 UTC (rev 479)
@@ -16,8 +16,8 @@
 \tabular{ll}{
 Package: \tab tcltk2\cr
 Type: \tab Package\cr
-Version: \tab 1.2-1\cr
-Date: \tab 2012-04-21\cr
+Version: \tab 1.2-3\cr
+Date: \tab 2012-05-01\cr
 License: \tab see LICENSE file\cr
 LazyLoad: \tab yes\cr
 }

Modified: pkg/tcltk2/test.R
===================================================================
--- pkg/tcltk2/test.R	2012-05-01 21:16:25 UTC (rev 478)
+++ pkg/tcltk2/test.R	2012-05-01 21:16:47 UTC (rev 479)
@@ -29,4 +29,4 @@
 tt <- tktoplevel()
 opts <- tclVar()
 sl <- tcl("swaplist::swaplist", tt, opts, 1:9, c(1, 3, 5))
-cat("You choose:", tclvalue(opts))
+cat("You choose:", tclvalue(opts), "\n")



More information about the Sciviews-commits mailing list