search for: tkpack

Displaying 20 results from an estimated 93 matches for "tkpack".

2007 Aug 14
2
Question about unicode characters in tcltk
...he \u2080 incorrectly? library(tcltk) m <-tktoplevel() frame1 <- tkframe(m) frame2 <- tkframe(m) frame3 <- tkframe(m) entry1 <- tkentry(frame1,width=5,bg='white') entry2 <- tkentry(frame2,width=5,bg='white') entry3 <- tkentry(frame3,width=5,bg='white') tkpack(tklabel(frame1,text='\u03bc\u2080'),side='left') tkpack(tklabel(frame2,text='\u03bc\u2081'),side='left') tkpack(tklabel(frame3,text='\u03bc\u2082'),side='left') tkpack(frame1,entry1,side='top') tkpack(frame2,entry2,side='top') tkpack(...
2003 Sep 09
1
charge a vector with variables and to use as variable in a checkbutton?
hello, how i cant to charge in form dynamic a checkbutton, try to do it with a vector be charged automaticamente but not works, for example library(tcltk) tt<-tktoplevel() f<-tkframe(tt) tkpack(f) i<-2 if (i==1) {b1<-tkcheckbutton (f,text="b1",variable="b1",relief="raised");tkpack(b1);print(tclvalue ("b1"))}else if (i==2) {b1<-tkcheckbutton (f,text="b1",variable="b1",relief="raised");tkpack(b1);print(tclvalue (...
2006 Jun 21
0
Some R-Tcl/Tk-BWidget newbie questions.
...d path to BWidgets addTclPath(".") version.BWidget <<- tclvalue(tclRequire("BWidget")) start.gui <- function() { # Toplevel tt <- tktoplevel() tkwm.title(tt, "MyTitle") # Notebook ### --> The following line makes R hang with 100% cpu forever #tkpack(tn <- tkwidget(tt, "NoteBook"), fill="both", expand=TRUE) ### --> This works, but not sticky="news", ### --> the notebook does not resize together with the window tn <- tkwidget(tt, "NoteBook") tkgrid(tn, sticky="news") ### --> I...
2001 Feb 03
1
callback environment for Tk buttons
..."} { pack [button $tt.b$i -text $i -command "puts $i"] -fill x } pack [button $tt.dismiss -text dismiss -command "destroy $tt"] -fill x If I translate this to R, I get: tt <- tktoplevel() for (i in c("hello", "HALLO")) tkpack (tkbutton (tt, text=i, command=function()cat(i,"world\n")), fill="x") tkpack (tkbutton (tt, text="dismiss", command=function()tkdestroy(tt)), fill="x") which is dumb, because the value of i is now always &q...
2003 Sep 08
1
add checkbutton and the variable(wrong length of vector "b")
...i<-1 while (i<=length(b)) { #the length of b is wrong!! print(tclvalue(b[i])) i<-i+1 } } borra<-function(){ assign("vectPath",c(),.GlobalEnv) assign("b",c(),.GlobalEnv) tkdelete(m,"0","end") } tt <- tktoplevel() tkpack(mb <- tkmenubutton(tt, text="Datos")) m <- tkmenu(mb,tearoff=FALSE) tkconfigure(mb,menu=m) b<-tkbutton(tt,text="abrir",command=function()archivos()) tkpack(b) b3<-tkbutton(tt,text="ver",command=function()ver()) tkpack(b3) b4<-tkbutton(tt,text="Borr...
2000 Sep 28
0
No subject
...tion() { + plot(xd$iv802, xd$PPT) + abline(0,1) + tt2 <- tktoplevel() + tktitle(tt2) <- "Identify Outliers" + lab.wid2 <- tklabel(tt2, text="Identify Outliers") + but.wid2 <- tkbutton(tt2, text="OK", command=function() tkdestroy(tt2)) + tkpack(lab.wid2, but.wid2) + labp <- identify(xd$iv802, xd$PPT, label=xd$FIPS) + dev.print(png, "pptlabs.png", width=600,height=600) + } + + templabs <- function() { + plot(xd$iv802, xd$AVGT) + abline(0,1) + tt2 <- tktoplevel() + tktitle(tt2) <- "Identify Out...
2012 May 24
3
set tkscale by tkentry
...orking under Windows and I am using R2.11 I want to use tkscale in my GUI. As the interval is quite big, I can't set the scale to a certain specific value. Therefore I want to add tkentry to allow the user to set tkscale to a certain value. Here is the code library(tcltk) tt<-tktoplevel() tkpack(m1<-tkscale(tt,from=306870.00, to=3026741, label="alpha", variable="varalpha",showvalue=TRUE, resolution=1, orient="horiz"),side="bottom") tkpack(tkentry(tt,width="10",textvariable="varalpha",validate="key",validatecommand=&qu...
2003 Aug 15
1
menubutton don´t work
...=arch, variable="archOp", value=arch) tkconfigure(b2,state="normal") } ver<-function(n){ tabla<-read.table(n,header=TRUE,comment.char="@") nbre<-names(tabla) tabla } tt<-tktoplevel() b<-tkbutton(tt,text="abrir",command=function()archivos()) tkpack(b) tkpack(mb <- tkmenubutton(tt, text="Datos",state="disabled")) m <- tkmenu(mb,tearoff=FALSE) tkconfigure(mb,menu=m) b2<-tkbutton(tt,text="Ver",command=function()ver(arch),state="disabled") tkpack(b2)
2008 Aug 11
3
tkentry that exits after RETURN?
...pass=tclVar("") label.widget <- tklabel(tt, text="Enter Password") password.widget <- tkentry(tt,show="*",textvariable=pass) ok <- tkbutton(tt,text="OK",default="active", command=function()tkdestroy(tt)) tkpack(label.widget, password.widget,ok) tkwait.window(tt) return(tclvalue(pass)) } thanks Ben Bolker -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 252 bytes Desc: OpenPGP digital signature URL: &...
2000 Sep 28
1
tcltk package functionality
...abs <- function() { plot(xd$iv802, xd$PPT) abline(0,1) tt2 <- tktoplevel() tktitle(tt2) <- "Identify Outliers" lab.wid2 <- tklabel(tt2, text="Identify Outliers") but.wid2 <- tkbutton(tt2, text="OK", command=function() tkdestroy(tt2)) tkpack(lab.wid2, but.wid2) labp <- identify(xd$iv802, xd$PPT, label=xd$FIPS) dev.print(png, "pptlabs.png", width=600,height=600) } templabs <- function() { plot(xd$iv802, xd$AVGT) abline(0,1) tt2 <- tktoplevel() tktitle(tt2) <- "Identify Outliers" la...
2008 Oct 27
1
ttkcombobox
...I've been struggling with the tcltk package and can't seem to get the ttkcombobox to work. Here's an example: library(tcltk) p <- tktoplevel() l <- tclVar() ## I don't know if I'm even calling it correctly cb <- ttkcombobox(p, values = letters[1:4], textvariable = l) tkpack(cb) 1. How do I know when the value of the combobox has been changed from, say, "a" to "b"? 2. How can I get the value of the box? E.g. if I switch the box to "b", how can I access this value? 3. How can I set the default value to something of my choice? I've tr...
2000 Sep 29
1
Two tcltk questions and Re: tcltk package functionality
...but.done <- tkbutton(tt, text="FINISHED", command=function(){ tclvar$done <- "T" tkdestroy(tt) } ) tkpack(label.widget, rbut.wid1, rbut.wid2, but.done) # wait until FINISHED is pressed tclvar$choice <- "0" tkwait.variable("done") # plot x1 or x2 if(tclvar$choice == "0") x <- x1 if(tclvar$choice == "1") x <- x2 if(is.null(names(x))) names(x) <- x...
2010 Jun 11
1
Windows, OSX and Linux: updating a graphic device and double buffering
...ffer my output manually? If not, is it possible to force update my graphic device. E.g. with a command like dev.flush()? How can I run my code on all operating systems without any "jumps"? Regards, Adrian Waddell Here is a minimal example code: library(tcltk) tt <- tktoplevel() tkpack(top <- tkframe(tt), side = "top") SliderValue <- tclVar("50") SliderValueLabel <- tklabel(top,text=as.character(tclvalue(SliderValue))) tkpack(tklabel(top,text="Slider Value : "),SliderValueLabel, side = "left") tkconfigure(SliderValueLabel,textvaria...
2009 Sep 28
2
re trieve user input from an tcl/tk interface
Hello everyone, this is my first post here and I hope I signed up correctly and someone will take me by the hand and help me out. I am new to R and cannot figure out what to do here... ... I want to have an User Interface that requests input. I want to save this input to a variable to use it later on. I was able to do this with a modalDiaglog (
2001 Sep 19
2
tcltk: Difficulties creating menus
...$mw->configure(-background => $background_color); } I cannot get anything similar to work under R. Adding a tkmenubutton is easy, but I fail to get it to "connect" to an actual menu composed of check or radiobuttons: library(tcltk) color<-"blue" tt <- tktoplevel() tkpack(mb <- tkmenubutton(tt, text="Color")) ## does nothing ## tkradiobutton(mb, variable=color, text="blue", value="blue", ## command=set.bg) ## ## Error: Error in .Tcl(.Tcl.args(...)) : ## [tcl] bad option "add": must be cget or configure. ## t...
2007 May 30
5
determining a parent function name
..."Error") tkmsg <- tktext(tt, bg = "white") tkinsert(tkmsg, "end", sprintf("Error in %s: %s", "???", msg)) tkconfigure(tkmsg, state = "disabled", font = "Tahoma 12", width = 50, height = 3) tkpack(tkmsg, side = "bottom", fill = "y") } stop(msg) } But, I would like to know from which function error() is called. For example, if I have foo <- function() stop() bar <- function() error() > foo() Error in foo() : > bar() Error in error() : and in the tk...
2003 Mar 27
0
R TclTk iwidgets::combobox
Thanks Peter, I've started a new R session (in Windows) and managed to get both ways working now : ### THIS WORKS !!! ### library(tcltk) tclRequire("IWidgets") tt<-tktoplevel() combo <- tkwidget(tt,"iwidgets::combobox") tkpack(combo) ### AND THIS WORKS TOO !!! ### tt<-tktoplevel() win <- .Tk.subwin(tt) .Tcl(paste("iwidgets::combobox",.Tk.ID(win),.Tcl.args())) tkpack(win) But they both fail in my old R session - maybe I've tclRequired another package or loaded another package which is interfering o...
2011 Sep 16
2
demo creating
R experts: I want to prepare a demo (that will play sequentially in clicks) for a presentation tutorial...Can somebody help me how can I write a demo, suppose the following are steps in the demo.. #start set.seed(1345) x1 <- sample(letters[1:10], 5) x1 sort(x1) x <- sample(1:10, 5) y <- sample(c(11:20), 5) require(lattice) plot(x,y) z <- rnorm(5, 1, 0.5) dataframe <-
2003 Jan 20
1
curious code mistakes
...assign("myData", zz, envir = .GlobalEnv) Error: syntax error >>} Error: syntax error >>tt <- tktoplevel() >>button.widget <- tkbutton(tt,text="Select SPSSFile", command=getfile) Error in .Tcl.args(...) : Object "getfile" not found >>tkpack(button.widget) Error in .Tcl.args(...) : Object "button.widget" not found >> >> >>getfile <- function() { + name <- tclvalue(tkgetOpenFile(filetypes="{{SPSS Files} {.sav}} {{All files} *}")) + if (name=="") return; +...
2010 Aug 05
1
Error in as.environment(pos): using 'as.environment(NULL)' is defunct
...j(VKG)),as.numeric(tclObj(HZ)) ,as.numeric(tclObj(VZ)),as.numeric(tclObj(Aktivit?t)),as.numeric(tclObj( tclArray1))))) } test2 <- local({source("C:/Berechnung_Funktion.R", local = TRUE) environment(Berechnung) <- .GlobalEnv Berechnung }) and: Button<-tkframe(InputOutputfenster) tkpack(Button, side='top') tkpack(tkbutton(Button, text='compute optimal solution',command=handler.Berechnung)) and the function in the other R-file: Berechnung<-function(a,b,c,d,e) { } Thanks!