|
setup diary |
require(tcltk) tt<-tktoplevel() tkwm.geometry(tt, "200x100") tkwm.title(tt,"Hello") tm<-tkmenu(tt) tkconfigure(tt,menu=tm) tmf<-tkmenu(tm,tearoff=FALSE) tkadd(tmf,"command",label="open", command=function(){fl<-tkgetOpenFile();cat(tclvalue(fl),"\n")}) tkadd(tmf,"command",label="quit",command=function(){tkdestroy(tt)}) tkadd(tm,"cascade",label="file",menu=tmf) tkpack(tf1<-tkframe(tt),side='left') tkpack(tf2<-tkframe(tt),side='left') tkpack(tklabel(tf1,text='hello')) tkpack(tkbutton(tf1,text='push', command=function()tkmessageBox(message="hello!"))) te<-tclVar("entry") tkpack(tkentry(tf2,width=10,textvariable=te)) tkpack(tkbutton(tf2,text='push',command=function()cat(tclvalue(te),"\n")))