search for: tkadd

Displaying 15 results from an estimated 15 matches for "tkadd".

Did you mean: tcadd
2008 Aug 19
1
Open directory within a menu in tcltk
...lowing code: opendir<-function() { dirname<<-tclvalue(tkchooseDirectory()) } openfile<-function() { filename<<-tclvalue(tkgetOpenFile()) } require(tcltk) t1<-tktoplevel() topMenu<-tkmenu(t1) tkconfigure(t1,menu=topMenu) plotMenu<-tkmenu(topMenu, tearoff=FALSE) tkadd(plotMenu,"command",label="Open file", command=openfile) tkadd(plotMenu, "command",label="Select directory",command=opendir) tkadd(plotMenu,"command",label="Quit", command=function() tkdestroy(t1)) tkadd(topMenu, "cascade", label=...
2010 Jul 22
1
check menu button (tcltk)
Hi,   I am making a mock user interface in tcltk and I would like to add a 'check menu button' such as shown here: http://zetcode.com/tutorials/pygtktutorial/images/checkmenuitem.png   Does anybody know how to do this? I am quite new to R. Cheers!! Albert-Jan ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ All right, but apart from the sanitation, the medicine,
2002 Feb 11
0
read.table in TCL/TK interface
...<<- file } exit <- function() { tkdestroy(tt)} build <- function() { y <- parse(text=tclvalue(yvar))[[1]] substitute(rpart(yvar ~.,data=file)) } tkadd(fileMenu,"command",label="Load",command=load) #tkadd(fileMenu,"command",label="Save",command=save) tkadd(fileMenu,"command",label="Exit",command=exit) tkadd(topMenu,"cascade",label=...
2008 Dec 22
1
newbie question on tcltk
...active", overrelief="flat", anchor="w"); tkgrid(ok.but2 ) tkgrid(tklabel(top,text=" ")) topMenu <- tkmenu(top) tkconfigure(top, menu = topMenu) fileMenu <- tkmenu(topMenu, tearoff = FALSE) openRecentMenu <- tkmenu(topMenu, tearoff = FALSE) tkadd(openRecentMenu, "command", label = "5 ", command = function() tkmessageBox( message = "xxxxx", icon = "error")) tkadd(openRecentMenu, "command", label = "6", command = function() tkmessageBox( message = "yyyyy...
2003 Aug 15
1
menubutton don´t work
...Op<-tclVar(init=" ") vectPath<-c() archivos<-function(){ f<-tkcmd("tk_getOpenFile") temparch<-tclvalue(f) assign("vectPath",c(vectPath,temparch),.GlobalEnv) cant<-length(vectPath) arch<-vectPath[cant] tkconfigure(mb,state="normal") tkadd(m, "radio", label=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",co...
2001 Sep 19
2
tcltk: Difficulties creating menus
...k(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. ## tkadd(mb, tkcheckbutton, label="blue", variable=color) ## ## Dito ## tkcmd("add", tkcheckbutton, label="blue", variable=color) tkpack(tkbutton(tt, text="Quit", command=function()tkdestroy(tt))) Any pointers or examples would be greatly appreciated. Thanks, Dirk...
2007 Jan 22
0
How to disable existing menus in tcltk?
...e of its options. Here's a snip of the code. How could I disable, for example, the Edit data menu choise after already creating the menu (I want it to be active initially)? gui<-tktoplevel() topMenu<-tkmenu(gui) tkconfigure(gui,menu=topMenu) editMenu<-tkmenu(topMenu, tearoff=FALSE) tkadd(editMenu, "command", label="Edit data", command=function() editData()) tkadd(editMenu, "command", label="Preferences", command=function() editPref()) tkadd(topMenu, "cascade", label="Edit", menu=editMenu) Thanks, Jarno Tuimala
2006 Aug 02
2
tcl/tk bind destroy event
...tkdestroy(mw) } if( returnVal == "cancel" ) { # do nothing cat("Cancel was pressed.\n") } } # bind the destroy event in order to show a message box tkbind(mw,"<Destroy>",exitProg) # menu item which works fine tkadd(fileMenu, "command", label="Quit", command=exitProg) Thank you. Franco Mendolia
2012 Nov 19
6
tcltk freezing using MS Windows for R-2.14+
...de to 30 lines! If you paste the following lines of code into an R window: testGUI <- function(){ require(tcltk) MainWindow <- tktoplevel() topMenu <- tkmenu(MainWindow) tkconfigure(MainWindow,menu=topMenu) normalizeMenu <- tkmenu(topMenu, tearoff=FALSE) tkadd(normalizeMenu,"command",label="Normalize",command = function() NormalizeNow(MainWindow)) tkadd(topMenu, "cascade", label="MainWindow", menu = normalizeMenu) tkfocus(MainWindow) # }#end of testGUI <- function() # NormalizeNow <- function(...
2003 Sep 08
1
add checkbutton and the variable(wrong length of vector "b")
...h<-tclvalue(f) assign("vectPath",c(vectPath,temparch),.GlobalEnv) temp<-0 assign("b",c(b,temp),.GlobalEnv) #charge the variable for the checkbutton cant<-length(vectPath) j<-vectPath[cant] tkadd(m, "check", label=j, variable=b[cant]) #add the variable } ver<-function(){ 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...
2008 Nov 08
1
Get Information
...enu(tt) tkconfigure(tt,menu=topMenu) cascade =function () {fileName=tclvalue(tkgetSaveFile(initialfile="modalite.txt",filetypes="{{JPEG Files} {.jpg .jpeg}} {{PDF File} {.pdf}} {{Text File} {.txt}} {{All files} *}")) return(fileName) } tkadd(topMenu,"command",label="Enregistrer",command=function () cascade()) Please correct the programme i send it back. Please, i need the correction to continue my projet. Thanks in advance. Ing KAMENI Justin Etudiant en Master en Statistique Option: Econométrie, Assurance et Fin...
2006 Aug 11
2
tkinsert
...icon="error") return() } cat("Executing from script window:", "-----", code, "result:", sep="\n") print(eval(e)) } topMenu <- tkmenu(tt) tkconfigure(tt, menu=topMenu) fileMenu <- tkmenu(topMenu, tearoff=FALSE) tkadd(topMenu, "command", label="Run", command=run) But when I run a=mean(c(1,2,3)) I have the result on my R console but i can't access to the result. If i write a, R don't know "a". Thanks a lot, and so sorry for my poor english, i hope you understand my pro...
2006 Jul 05
1
tcl/tk with R
...y Peter Dalgaard in Rnews, Volume 1/3, September 2001. Are there more recent do-it-yourself instructions available? I have been unsuccessful with the example in the tcltk2 package due to a syntax error. I think that I have isolated the problem to this code snippet: for (i in 1:length(Themes)) { tkadd(themeMenu, "command", label = Themes[i], command = eval(parse(text = paste("function() tk2theme(\"", Themes[sep = "")))) } And the problem seems to be here: paste("function() tk2theme(\"", Themes[sep = "")) Error: syntax error in "...
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
2008 Dec 29
0
Serial Correlation Test for Short Time Series
...quot;active", overrelief="flat", anchor="w"); tkgrid(ok.but2 ) tkgrid(tklabel(top,text=" ")) topMenu <- tkmenu(top) tkconfigure(top, menu = topMenu) fileMenu <- tkmenu(topMenu, tearoff = FALSE) openRecentMenu <- tkmenu(topMenu, tearoff = FALSE) tkadd(openRecentMenu, "command", label = "5 ", command = function() tkmessageBox( message = "xxxxx", icon = "error")) tkadd(openRecentMenu, "command", label = "6", command = function() tkmessageBox( message = "yyyyy...