@@ -147,7 +147,7 @@ tk2notetab <- function (nb, tab)
147147 w $ env <- new.env()
148148 w $ env $ num.subwin <- 0
149149 w $ env $ parent <- nb
150- class(w ) <- c(" ttk2notetab " , " tk2container" , " tkwin" )
150+ class(w ) <- c(" tk2notetab " , " tk2container" , " tkwin" )
151151 return (w )
152152 } else return (NULL ) # Tab not found!
153153 } else stop (" 'nb' must be a 'tk2notebook' object" )
@@ -197,7 +197,7 @@ tk2theme <- function (theme = NULL)
197197 # # First, check if the theme is already loaded... or try loading it
198198 loadedThemes <- tk2theme.list()
199199 if (! theme %in% loadedThemes ) {
200- # # Could be plastik, keramik, keramik_alt, clearlooks, radiance
200+ # # Could be plastik, keramik, keramik_alt, clearlooks, radiance
201201 res <- try(tclRequire(paste0(" ttk::theme::" , theme )), silent = TRUE )
202202 if (inherits(res , " try-error" ))
203203 stop(" Ttk theme " , theme , " is not found" )
@@ -243,12 +243,12 @@ tk2theme <- function (theme = NULL)
243243 " throughColor" , hfg ),
244244 " fieldBackground" ,
245245 tclvalue(.Tcl(" ttk::style lookup TEntry -fieldbackground" )))
246-
246+
247247 # # Set menu font the same as label font
248248 font <- tclvalue(.Tcl(" ttk::style lookup TLabel -font" ))
249249 if (! length(font ) || font == " " ) font <- " TkDefaultFont"
250250 tk2font.set(" TkMenuFont" , tk2font.get(font ))
251-
251+
252252 # # Return the theme
253253 res <- theme
254254 }
@@ -257,10 +257,10 @@ tk2theme <- function (theme = NULL)
257257# ## Note: to change a style element: .Tcl('ttk::style configure TButton -font "helvetica 24"')
258258# ## Create a derived style: ttk::style configure Emergency.TButton -font "helvetica 24" -foreground red -padding 10
259259# ## Changing different states:
260- # ##ttk::style map TButton \
261- # ## -background [list disabled #d9d9d9 active #ececec] \
262- # ## -foreground [list disabled #a3a3a3] \
263- # ## -relief [list {pressed !disabled} sunken] \
260+ # ##ttk::style map TButton \
261+ # ## -background [list disabled #d9d9d9 active #ececec] \
262+ # ## -foreground [list disabled #a3a3a3] \
263+ # ## -relief [list {pressed !disabled} sunken] \
264264# ## ;
265265
266266# # Function to look for a ttk style
@@ -298,7 +298,7 @@ tk2style <- function (class, style, state = c("default", "active",
298298 style = paste(" -" , as.character(style )[1 ], sep = " " )
299299 state = match.arg(state )
300300 if (is.null(default )) default <- " "
301-
301+
302302 # # styles creates a named vector (items in even elements, labels = odd)
303303 styles <- function (x ) {
304304 st <- as.character(x )
@@ -311,7 +311,7 @@ tk2style <- function (class, style, state = c("default", "active",
311311 names(st ) <- stnames
312312 return (st )
313313 }
314-
314+
315315 # # First look at the map for this class
316316 res <- styles(tcl(" ttk::style" , " map" , class , style ))
317317 res2 <- styles(tcl(" ttk::style" , " map" , " ." , style ))
@@ -321,7 +321,7 @@ tk2style <- function (class, style, state = c("default", "active",
321321 res2 <- styles(tcl(" ttk::style" , " configure" , " ." , style ))
322322 res <- c(res , res2 [! names(res2 ) %in% names(res )])
323323 if (length(res ) == 0 ) res <- c(default = default )
324-
324+
325325 # # If state != "all", try to resolve the right state
326326 if (state != " all" ) {
327327 # # If the given state is there, use it
@@ -384,7 +384,7 @@ tk2dataList <- function (x)
384384 tk2text = c(" values" , " value" , " selection" , " maxundo" , " undo" ,
385385 " spacing1" , " spacing2" , " spacing3" , " tabs" , " tabstyle" ),
386386 tk2tree = c(" values" , " value" , " selection" ),
387- stop(" Unknown tk2widget, provide a tk2widget object or its class" )
387+ stop(" Unknown tk2widget, provide a tk2widget object or its class" )
388388 )
389389 # # Add label, tag & tip for all
390390 res <- c(res , " label" , " tag" , " tip" )
@@ -449,7 +449,7 @@ setLanguage <- function (lang)
449449 # If the tcl.language attribute is defined, use it
450450 tcllang <- attr(lang , " tcl.language" )
451451 if (! is.null(tcllang ) && tcllang [1 ] != " " ) {
452- lang <- tcllang [1 ] # Use only first item
452+ lang <- tcllang [1 ] # Use only first item
453453 } else {
454454 # Tcl does not accept locales like en_US.UF-8: must be en_us only
455455 lang <- tolower(sub(" ^([^.]+)\\ ..*$" , " \\ 1" , lang ))
@@ -469,11 +469,11 @@ getLanguage <- function ()
469469 # # This is a bad hack that probably does not work all the time, but at least,
470470 # # it works under Windows for getting "fr" for French language
471471 if (lang == " " ) lang <- tolower(substr(Sys.getlocale(" LC_COLLATE" ), 1 , 2 ))
472-
472+
473473 # # Try to get language information from Tcl
474474 tcllang <- try(as.character(tcl(" mcpreferences" )), silent = TRUE )
475475 attr(lang , " tcl.language" ) <- tcllang
476-
476+
477477 lang
478478}
479479
0 commit comments