search for: tkcurselect

Displaying 8 results from an estimated 8 matches for "tkcurselect".

2004 Feb 09
2
data.frame to matrix
...er data.matrix() and as.matrix(). After executing one of those I end up with another data.frame with only the first column of the original data.frame. I use a window (tcltk) to let the user choose the columns he wants and then I retrieve them using the following: varstemp <- .numeric[as.numeric(tkcurselection(subgroupsBox)) + 1] where ".numeric" is the original (complete) data.frame. Any ideas why is this happening? I'm using R1.8.1 in WinXP by the way. Thanks.
2001 Feb 22
2
Problem with tcltk listbox
...-tklistbox(anzeigeframe,exportselection="0") sas.yscroll<-tkscrollbar(anzeigeframe) tkconfigure(sas.listbox,yscrollcommand=paste(.Tk.ID(sas.yscroll),"set")) tkconfigure(sas.yscroll,command=paste(.Tk.ID(sas.listbox),"yview")) selection<- tkget(prot.listbox,tkcurselection(prot.listbox)) s1 <- substr(selection,1,4) s2 <- substr(selection,6,6) ... doing something i<-1 while (i <= length(resultset[,1])) { tkinsert(protas.listbox,'end',paste(resultset[i,1],resultset[i,2],sep=".")) t...
2013 Aug 03
1
tk + browser() can leave R unresponsive
...2. Run 'library(tcltk)' 3. Run 'trace(tk_select.list, edit = TRUE)' and put "browser()" at the beginning of the onOK body (e.g. in Vim run <<:g/onOK/put ='browser()'>>). That is, transform onOK <- function() { res <- 1L + as.integer(tkcurselection(box)) cat("res is: ", res) ans.select_list <<- choices[res] tkgrab.release(dlg) tkdestroy(dlg) } to: onOK <- function() { browser() res <- 1L + as.integer(tkcurselection(box)) cat("res is: ", res)...
2008 Jul 22
1
tklistbox and extracting selection to R
...;single",background="white") tkgrid(tklabel(tt,text="Select the legend of" )) tkgrid(tl) treatments<<-levels.tx for(i in (1:ntx)) { tkinsert(tl,"end",treatments[i]) } OnOK<-function() { tx.choice1<<-treatments[as.integer(tkcurselection(tl))+1] tkdestroy(tt) } OK.but<-tkbutton(tt,text=" OK ", command=OnOK) tkgrid(OK.but) tx.choice1 the console can't find tx.choice1, but if I type tx.choice1 directly into the console, it returns the value I selected from the list. I am runn...
2008 Nov 23
1
tklistbox - R-Objekt
...bel(tt,text="select method for LAI calculation")) tkgrid(tl) method<- c("method1","method2") for (i in (1:2)){ tkinsert(tl,"end",method[i]) } tkselection.set(tl,0) OnOK <- function(){ choice<-method[as.numeric(tkcurselection(tl))+1] tkdestroy(tt) } OK.but <-tkbutton(tt,text=" OK ",command=OnOK) tkbind(tkgrid, "<Return>",OnOK) tkgrid(OK.but) The function works, but it does not create any r-object to that I can access later on. How do I have to modif...
2010 Mar 01
0
Multicolumn Listbox selectcommand trouble
...nction(...)tkyview(txtviewer,...)) tkgrid(txtviewer, scr2) tkgrid.configure(scr2, sticky = "ns") tkmark.set(txtviewer,"insert","0.0") tkinsert(txtviewer,"end","This is some stuff") DeleteSelection <- function() { fruitIndex <- as.integer(tkcurselection(mlb)) tkdelete(mlb,fruitIndex) } DeleteSelection.but <- tkbutton(editor,text="Delete",command=DeleteSelection) tkgrid(DeleteSelection.but) tkfocus(txtviewer) tkpack(editor, side = "bottom")
2005 Apr 01
0
Selections from tcltk list boxes
...]) tkinsert(listbox, "end", x) value <- tclVar("") entry <- tkentry(top, width="2", textvariable=value) onOK <- function(){ tkdestroy(top) print(tclvalue(value)) return() } onSelect <- function(){ selection <- letters[1:10][as.numeric(tkcurselection(listbox)) + 1] tclvalue(value) <- selection } OK <- tkbutton(top, text="OK", command=onOK) tkgrid(listbox, entry, sticky="nw") tkgrid(OK) tkbind(listbox, "<ButtonPress-1>", onSelect) As I understand it, single-clicking on an entry in the list bo...
2013 Sep 01
1
[PATCH] remove a duplicate tk function definition (and alphabetize)
...tion(widget, ...) tcl(widget, "coords", ...) tkcreate <- function(widget, ...) tcl(widget, "create", ...) -tkcget <- function(widget, ...) tcl(widget, "cget", ...) -tkcoords <- function(widget, ...) tcl(widget, "coords", ...) tkcurselection <- function(widget, ...) tcl(widget, "curselection", ...) tkdchars <- function(widget, ...) tcl(widget, "dchars", ...) tkdebug <- function(widget, ...) tcl(widget, "debug", ...) @@ -508,8 +507,8 @@ tkdlineinfo <- function(widget, ....