search for: textvariable

Displaying 20 results from an estimated 32 matches for "textvariable".

2008 Aug 11
3
tkentry that exits after RETURN?
...date, validatecommand, but don't see any obvious way to do it ... getPassword <- function(){ require(tcltk) tt <- tktoplevel() 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...
2009 Apr 28
1
[macosx] improving quartz & Aqua Tk behaviour outside of RGui
Hello, On Mac OS X, certain Aqua/Quartz UI functionality requires an application to be launched from within an app bundle, or (alternatively) requires a Carbon application with a resource fork. Playing with the wxWidgets distribution, I discovered that it is quite easy and transparent to make such a Carbon app from (I guess) any command line application. When applied to the R executable called
2009 Apr 28
1
[macosx] improving quartz & Aqua Tk behaviour outside of RGui
Hello, On Mac OS X, certain Aqua/Quartz UI functionality requires an application to be launched from within an app bundle, or (alternatively) requires a Carbon application with a resource fork. Playing with the wxWidgets distribution, I discovered that it is quite easy and transparent to make such a Carbon app from (I guess) any command line application. When applied to the R executable called
2009 Jul 09
1
Changing text in a tkentry widget
...f a tkentry widget when a button is pressed. Once I get that working, the widget will be read only to the user. Here is some toy code: ############### require(tcltk) thisEnv=environment() tt<-tktoplevel() Name <- tclVar("Anonymous") entry.Name <-tkentry(tt,width="20",textvariable=Name) tkgrid(entry.Name) OnChange <- function() { assign("Name",tclVar("changed name"),thisEnv) } Change.but <-tkbutton(tt,text=" Change ",command=OnChange) tkgrid(Change.but) tkfocus(tt) ################## (much of this is taken from http://bioinf.wehi....
2008 Oct 27
1
ttkcombobox
...nInfo at the end) 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?...
2009 Sep 28
2
re trieve user input from an tcl/tk interface
...I reckon this is where the important stuff should happen... tkdestroy(tt) } require(tcltk) tclRequire("BWidget") tt = tktoplevel() trials = tclVar("100") # I want to suggest default values but they should be editable. entry.trials = tkentry(tt, width = "3", textvariable = trials) tkgrid(tklabel(tt,text="Number of trials:")) tkgrid(entry.trials) Stimuli = tclVar("10") # I want to suggest default values but they should be editable. entry.Stimuli = tkentry(tt, width = "3", textvariable = Stimuli) tkgrid(tklabel(tt, text = "N...
2012 May 24
3
set tkscale by tkentry
...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="string is double %P"),side="bottom") As you can see, varalpha is a global variable (I think in tcl, not in R), and if you change the parameter by the scale, the value in tkentry is updated. If I want to set now the...
2006 May 22
1
rerender tcltk toplevel
...riable assigned to it. This works nicely on windows systems but on my linux box (Suse10) the label is not updated on every round of iteration but rather once the iterator finishes. tt <-tktoplevel() tkwm.geometry(tt, "250x140") prog <- tclVar("0") label <- tklabel(tt, textvariable=prog) tkgrid(label) for(i in 1:50) { tmp <- rnorm(1e+05) tclvalue(prog) <- i*2 } When I combine both approaches and add the label to a toplevel that already contains the progress bar updating the label works: tt <-tktoplevel() tkwm.geometry(tt, "250x140") prog <- t...
2006 Mar 07
2
Building tkentry dynamicly
...way : library(tcltk) main<-tktoplevel() tktitle(main)<-"My Tool" filenames<-c("toto","tata","titi") N<-length(filenames) for (i in 1: N) { text<-tclVar(filenames[i]) # get a filename (string value) textField<-tkentry(main,textvariable=text) # build a text field tkgrid(textField) } The problem is : How to keep references for each tclVar created, in order to acces to the text modifications eventually done for each field ? Example : (Embedded image moved to file: pic14771.jpg) to (Embedded image moved to file:...
2000 Jul 19
1
How to use tcltk?
...urther examples showing Tcl/Tk package in action. Therefore my question: Is there a pool of well designed applications of tk functions? / Have you created a beautiful example? Here is one of my problems: To print the position of the mouse cursor the following lines of code will work: label .l2 -textvariable tvar pack .l2 bind . <Motion> { set tvar "position %x %y" } bind . <Leave> { set tvar "mouse outside" } However, I have not been able to implement this by tk* functions of the R package. Any idea? Peter Wolf (system: hppa2.0, hpux10.20, major: 1...
2005 Oct 24
1
tk problem with R 2.2.0 on wine/linux
...<Return> to start : > require(tcltk) || stop("tcltk support is absent") [1] TRUE > require(stats) [1] TRUE > local({ dialog.t.test <- function() { tt <- tktoplevel() tkwm.title(tt, "t test") x.entry <- tkentry(tt, textvariable = xvar) y.entry <- tkentry(tt, textvariable = yvar) alt <- tclVar("two.sided") d .... [TRUNCATED] ****************************************************** The source for this demo can be found in the file: C:/PROG~FBU/R/R-2_~MVR.0/library/tcltk/demo/tktt...
2010 Aug 05
1
Error in as.environment(pos): using 'as.environment(NULL)' is defunct
...#(a is defined by a tkentry-element) VZ<-tclVar(seq(length=a,from=1,by=0)) Aktivit?t<-tclVar(seq(length=a,from=1,by=0)) VKG<-tclVar(3) Zugeh?rigkeit is a matrix. #The values can be changed by a tkentry-element. handler.Berechnung<-function() { tkconfigure(Ergebnisfenster, textvariable=tclVar(test2(as.numeric(tclObj(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&lt...
2007 Jan 01
0
autofill for a tkentry field
...", "Banana", "Peach", "Pear", "Plum", "Mango") tkdestroy(tt) tt <- tktoplevel() pw <- tkframe(tt) ppw <- tk2labelframe(pw, text="Fruits:") f1 <<- tclVar("") entry1.f <- tkentry(ppw, width=30, textvariable=f1, validate="key", validatecommand=autofill) tkgrid(entry1.f) tkgrid(ppw) tkgrid(pw) I don't know how to pass arguments to the autofill function, so I can manipulate the textvariable. Any help is much appreciated. If we get a working solution, maybe we...
2006 Oct 23
1
R tcl/tk
...I want to create a frame and put that frame inside the toplevel frame. This works (i.e. it places text in col 1, and the corresponding entry box in column 2) and later frame.2 resides where it should in the toplevel frame. tkgrid(tklabel(frame.2, text="FACTOR column "), tkentry(frame.2, textvariable=FACTOR.column.value, width=2), sticky="e") This doesn't work because I don't know how to tell tcl that answer.button1 belongs in frame2: tkconfigure(answer.button1, variable=buttonValue, value="TRUE") tkgrid(tklabel(frame.2, text="Question? yes "), answ...
2008 Oct 30
1
tklistbox selection
...y(tcltk) tt <- tktoplevel() tcl1 <- tclVar() tcl2 <- tclVar() tclObj(tcl1) <- letters[1:5] tclObj(tcl2) <- LETTERS[1] tb1 <- tklistbox(tt, listvariable = tcl1, selectmode = "multiple") tb2 <- ttkcombobox(tt, values = LETTERS[1:2], textvariable = tcl2) tkpack(tb1, tb2) First, I select some values in the list box. But when I select a value from the combo box, the selection from the list box is no longer highlighted. Is this a bug or am I missing something in the documentation? My goal is to allow highlighted text simultaneously in bot...
2010 Aug 11
0
R and TK Error "can't find objects"
...n of the variables, the handler and the link to the function which multiply Zahl, Exponent and Factor) : require(tcltk) Ergebnis<-tclVar(c(0,0,0,0,0,0)) Zahl<-tclVar(c(0,0,1,1,1,0)) Exponent<-tclVar(c(1,1,1,1,1,1)) Factor<-tclVar(2) handler.Quadrieren<-function() { tkconfigure(e, textvariable=tclVar(test2(as.numeric(tclObj(Zahl)),as.numeric(tclObj(Exp onent)),as.numeric(tclvalue(Faktor))))) } test2 <- local({source("C:/.../Tk_einfach.R", local = TRUE) environment(Quadrieren) <- .GlobalEnv Quadrieren }) Now I want to do the same with my more difficul...
2011 Oct 06
0
initial value in ComboBox tkwidget
Hello, I took me very long to find out how to set the initial value in the combobox widget in tk (see the example below). My question is now : Why does "textvariable" has to be a tclVar while "values" can be a normal vector? My next question is: How could I have known this much earlier? Is there a documentation for the tcl/tk usage in R? I know a lot of website with example. But the documentation is not very complet. Any tipps? require(tcltk) tc...
2001 Oct 06
1
tcltk
...me ? thanks for advance & regards,christian require (tcltk) || stop("tcltk support is absent") require(cluster) require(mva) require(foreign) local ({ dialog.fc <- function() { tt <- tktoplevel() tkwm.title(tt,"Fuzzy-ClusterAnalysis") cdata.entry <- tkentry(tt,textvariable="cdata") k.entry <- tkentry(tt,textvariable="k") reset <- function () { tclvar$cdata <- "" tclvar$k <- "" } reset.but <- tkbutton(tt,text="Reset", command=reset) submit.but <- tkbutton(tt,text="submit",com...
2007 Aug 14
2
Question about unicode characters in tcltk
hello list, Can someone help me figure out why the following code doesn't work? I'm trying to but both Greek letters and subscripts into a tcltk menu. The code creates all the mu's, and the 1 and 2 subscripts, but it won't create the 0. Is there a certain set of characters that R won't recognize the unicode for? Or am I input the \u2080 incorrectly? library(tcltk) m
2012 May 03
2
Help with readBin
I'm trying to read a binary file created by a fortran code using readBin and readChar. Everything reads fine (integers and strings) except for double precision numbers, they are read as huge or very small number (1E-250,...). I tried various endianness, swap, But nothing has worked so far. I also tried on R 64 bit for linux and windows (R 2.14) and R 2.11 on windows XP 32 bit. Any help would