Displaying 14 results from an estimated 14 matches for "tkmenu".
Did you mean:
tekmenu
2008 Aug 19
1
Open directory within a menu in tcltk
Hello,
I am trying to setup a menu to open files and directories. I have the following 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="Qui...
2006 Aug 11
2
tkinsert
...rits(e, "try-error")) {
tkmessageBox(message="Syntax error",
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 "...
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,
2008 Dec 22
1
newbie question on tcltk
...rid(ok.but1)
tkgrid(tklabel(top,text=" "))
ok.but2 <- tkbutton(top, text = "2. ", width=20, font=fontHeading, default="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 = &...
2012 Nov 19
6
tcltk freezing using MS Windows for R-2.14+
...t Mac or Unix. see
details below.
After considerable testing I have reduced the problem from a few
thousand lines of code 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"...
2001 Sep 19
2
tcltk: Difficulties creating menus
...; \&set_bg,
-variable => \$background_color, -value => $_);
}
MainLoop;
sub set_bg {
print "Background value is now: $background_color\n";
$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="...
2007 Jan 22
0
How to disable existing menus in tcltk?
..., but it seems that neither
tkconfigure nor tkentryconfigure contains the state as one 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, "cas...
2011 Nov 21
1
invalid command name "tk::MenuDup"
Hi to all,
I'm developping an user interface in TCL/TK but in some computers this error
occurs :
<Tcl> invalid command name "tk::MenuDup"
when the user runs :
tm <- tktoplevel(height=500,width=800)
topMenu <- tkmenu(tm)
tkconfigure(tm,menu=topMenu)
i don't understand why this code works on my computer and is not running on
other user environment ?
thanks,
--
View this message in context: http://r.789695.n4.nabble.com/invalid-command-name-tk-MenuDup-tp4091092p4091092.html
Sent from the R help mailing li...
2002 Feb 11
0
read.table in TCL/TK interface
...;
tt <- tktoplevel()
tktitle(tt) <- "Tcl/TK Decision Tree Window "
yvar <- "EKV"
y.entry <- tkentry(tt,textvariable=yvar)
submit.but <- tkbutton(tt,
text="submit",command=function()tclvalue(done)<-1)
done <- tclVar(0)
tkpack(y.entry)
topMenu <- tkmenu(tt)
tkconfigure(tt,menu=topMenu)
fileMenu <- tkmenu(topMenu,tearoff=FALSE)
load <- function() {
file <- tkcmd("tk_getOpenFile")
if (!length(file)) return()
chn <- tkcmd("open", file, "r")
#tkinsert(txt,"0.0",tk...
2003 Aug 15
1
menubutton don´t work
...p", 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)
2003 Sep 08
1
add checkbutton and the variable(wrong length of vector "b")
...ile (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="Borrar",command...
2008 Nov 08
1
Get Information
...the file, i do not find the file save, please help me, in order to continue my projet.
this is the programme:
tt <- tktoplevel()
txt <- tktext(tt)
tkwm.title(tt,"Saisi des modalités") #intitule la fenêtre
tkgrid(txt)
tkmark.set(txt,"insert","0.0")
topMenu <- tkmenu(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)
}
tka...
2003 Mar 06
1
tkexit
Sorry, my question is if exists a command tkexit in R, i need a command how
exit of tcl for close an aplication. How to use him. Thank
2008 Dec 29
0
Serial Correlation Test for Short Time Series
...;tkgrid(ok.but1)
tkgrid(tklabel(top,text=" "))
ok.but2 <- tkbutton(top, text = "2. ", width=20, font=fontHeading,
default="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 = &qu...