search for: tkbutton

Displaying 20 results from an estimated 94 matches for "tkbutton".

2012 Jul 16
2
Tk grid problem
...| | | | | C | | A |--------| | | | ---------- D | | | | | B | | ------------------- A is 2x2 C is 1x2 B is 1x2 D is 2x2 but the code bellow dont work : require(tcltk) tt <- tktoplevel(borderwidth=10) A.but <- tkbutton(tt,text="A",command=function()ls()) B.but <- tkbutton(tt,text="B",command=function()ls()) C.but <- tkbutton(tt,text="C",command=function()ls()) D.but <- tkbutton(tt,text="D",command=function()ls()) tkgrid(A.but,row=1,column=1,columnspan=2,rowspan=2...
2011 Feb 27
1
R Tcl/Tk [MacOSX] TkButton Problem
Hi, I have a tktoplevel window and in it a tkbutton: AUS <- function() { foo(parameters); } AUSButton.but <- tkbutton(tt,text="OK",command=AUS) The function foo(...) does a time-consuming calculation, and during this calculation there is printed some progress information to the console. My problem: When I click the button "O...
2001 Feb 03
1
callback environment for Tk buttons
...{ pack [button $tt.b$i -text $i -command "puts $i"] -fill x } pack [button $tt.dismiss -text dismiss -command "destroy $tt"] -fill x If I translate this to R, I get: tt <- tktoplevel() for (i in c("hello", "HALLO")) tkpack (tkbutton (tt, text=i, command=function()cat(i,"world\n")), fill="x") tkpack (tkbutton (tt, text="dismiss", command=function()tkdestroy(tt)), fill="x") which is dumb, because the value of i is now always "HALLO&...
2006 Jun 30
1
tkbutton command - how to know which button was clicked?
...se of lazy evaluation? I.e. arg is evaluated at the time the button is pressed? And, if so, how can I avoid this? I tried function() {force(arg); print(arg)} but that didn't work either. Thanks, Jeebee. for(rek in seq(1,nrow(rekeningen))) { arg <- rekeningen$rekening[rek] tkgrid(tkbutton(frame.1, text=paste("Saldo historie", arg), command=function() print(arg)), sticky="news") }
2005 Jun 04
2
locator() via tcltk
...s/, plus a post in R-help sometime ago, but haven't found a solution. The idea goes something like this: require(tcltk) testplot <- function() { getcoords <- function(...) { locator(5) } x <- 1:1000 y <- rnorm(1000) plot(x, y) base <- tktoplevel() loc.pts <- tkbutton(base, text = "Get coordinates", command = getcoords) quit.but <- tkbutton(base, text = "Quit", command = function() tkdestroy(base)) tkpack(loc.pts, quit.but) } I'd like testplot to return the value from getcoords. The "Get coordinates&quo...
2000 Sep 28
0
No subject
....widget <- tklabel(tt, text="Choose!") + + pptlabs <- function() { + plot(xd$iv802, xd$PPT) + abline(0,1) + tt2 <- tktoplevel() + tktitle(tt2) <- "Identify Outliers" + lab.wid2 <- tklabel(tt2, text="Identify Outliers") + but.wid2 <- tkbutton(tt2, text="OK", command=function() tkdestroy(tt2)) + tkpack(lab.wid2, but.wid2) + labp <- identify(xd$iv802, xd$PPT, label=xd$FIPS) + dev.print(png, "pptlabs.png", width=600,height=600) + } + + templabs <- function() { + plot(xd$iv802, xd$AVGT) + abline(0,...
2003 Sep 08
1
add checkbutton and the variable(wrong length of vector "b")
...orra<-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=function()borra()) tkpack(b4)
2008 Aug 11
3
tkentry that exits after RETURN?
...39;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 non-text attachment was scru...
2009 Oct 19
1
Problem with geometry manager in TclTK
...onOK <- function() { ReturnFormat <<- tclvalue(file.format) tkgrab.release(ask.form) tkdestroy(ask.form) } onCancel <- function() { tkgrab.release(ask.form) tkdestroy(ask.form) } Buttons.frame <- tkframe(ask.form, relief="groove") OK.but <- tkbutton(Buttons.frame, text = " OK ", command = onOK) cancel.but <- tkbutton(Buttons.frame, text = "Cancel", command = onCancel) tkgrid(cancel.but, OK.but, ipadx=20) tkgrid(Buttons.frame) print(as.integer(tclvalue(tkwinfo("height", ask.form)))) tkbind(ask.form...
2008 Mar 19
1
Radio Buttons or similars
...f (rbVal=="apples") tkmessageBox(message="Good choice! An apple a day keeps the doctor away!") if (rbVal=="oranges") tkmessageBox(message="Good choice! Oranges are full of Vitamin C!") print(rbVal); return(rbVal); } OK.but <- tkbutton(tt,text="OK",command=function() aux_function()) #OK.but <- tkbutton(tt,text="OK",command=function() value<<-aux_function()) tkgrid(OK.but) tkfocus(tt) #return(value) } Thanks in advance! A greetings Luismi -- View this message in context: http://www.nabble.c...
2008 Dec 22
1
newbie question on tcltk
...examples but my results were unsatisfactory. Thank you and have a great day ahead. #my code library(tcltk) rm(list=ls()) top <- tktoplevel(padx=70, pady=70) frameOverall <- tkframe(top) frameUpper <- tkframe(frameOverall,relief="groove",borderwidth=2) back_but <- tkbutton (frameUpper, text = "BACK", width=20, height=1, default="active", overrelief="flat",anchor="w", borderwidth=4 ) tkgrid(frameUpper) tkgrid(frameOverall) tkpack (frameUpper, back_but, side='left', anchor='n') tkgrid(tklabel(top,text="...
2002 Sep 26
3
tcltk - command=function()
...just having the idea create a simple tcl/tk gui-dialog for different data-file formats i get starting problems and it would be nice get some tips/tricks from experienced tcl/tk user in R ! tt <- tktoplevel() label.widget <- tklabel(tt,text="Decision Tree GUI") button.widget <- tkbutton(tt,text="Select SPSSFile", command=function() read.spss("C:/Cummulative/data/wekaSpecial.sav", use.value.label=T,to.data.frame=T)) tkpack(label.widget,button.widget) tkdestroy(tt)) ....how i have to use command=function() that this works like cat command ( i get no error me...
2007 Oct 08
3
tcltk scrollbar
...the first one (column 1 of main window) is the only one constantly off. library(tcltk) tt<-tktoplevel() mainFont<-tkfont.create(family="times",size=16) lbl.MainT<-tklabel(tt,text="Basic Manipulation",font=mainFont) tkgrid(lbl.MainT,sticky="nw") but.Browse<-tkbutton(tt,text=" Browse ",command=browse) but.Apply<-tkbutton(tt,text=" Apply ") scr1 <- tkscrollbar(tt, repeatinterval=5,command=function(...)tkyview(lsbDim1,...)) scr2 <- tkscrollbar(tt, repeatinterval=5,command=function(...)tkyview(lsbDim2,...)) lsbDim1<-tklistbox(tt,hei...
2005 Jul 12
1
help: how to use tkevent.generate(...)
...just like using a mouse to click. If tkevent.generate can do that? I tried it as below, but failed. Please give me a hint! tt <- tktoplevel() tkwm.title(tt,"Simple Dialog") onOK <- function(){print("OK")} onCancel <- function(){print("Cancel")} OK.but <- tkbutton(tt, text=" OK ", command=onOK) Cancel.but <- tkbutton(tt, text="Cancel",command=onCancel) tkgrid(OK.but,Cancel.but) tkevent.generate(tt, onOK) Thank you, Shengzhe
2008 Oct 22
0
Bug when importing datas with tcltk window (PR#13191)
...ot;Aucun fichier n'a ?t? s?lectionn?!") else tkmessageBox(message=paste("Vous avez s?lectionn? le fichier ",name3)) assign("fileName3",name3,envir=.GlobalEnv) } tt <- tktoplevel() tkwm.title(tt,"Import des fichiers de donn?es") button.widget <- tkbutton(tt,text="Table de donn?es d'observations ",command=openObservations.f) button.widget2 <- tkbutton(tt,text="Table de donn?es sur les unit?s d'observation ",command=openUnitobs.f) button.wid...
2012 Feb 24
1
tcl tk command function with arguments ??
Hello, I am using R 2.11.1 under Windows XP. I would like to know if its possible to use a function with arguments as a command in tcl tk. For example require(tcltk) PressedOK <- function() { tkmessageBox(message="You pressed OK!") } tt <- tktoplevel() OK.but <- tkbutton(tt,text="OK",command=PressedOK) tkgrid(OK.but) tkfocus(tt) the function PressedOK has no arguments and its use in "tkbutton(tt,text="OK",command=PressedOK)" is without any brackets. Unfortunately I would like to use several buttons and therefor define the correspondin...
2003 Aug 15
1
menubutton don´t work
...e(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",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&q...
2004 Jun 09
1
Using macros
...mm), deparse(expr)) ## return the macro ff } OKCancelHelp <- defmacro(window=top, OKbutton=OKbutton, onOK=onOK, cancelButton=cancelButton, onCancel=onCancel, helpButton=helpButton, onHelp=onHelp, helpSubject, expr={ OKbutton <- tkbutton(window, text="OK", fg="darkgreen", width="12", command=onOK, default="active") onCancel <- function() { tkdestroy(top) } cancelButton <- tkbutton(window, text="Cancel", fg="red&qu...
2011 Sep 16
2
demo creating
R experts: I want to prepare a demo (that will play sequentially in clicks) for a presentation tutorial...Can somebody help me how can I write a demo, suppose the following are steps in the demo.. #start set.seed(1345) x1 <- sample(letters[1:10], 5) x1 sort(x1) x <- sample(1:10, 5) y <- sample(c(11:20), 5) require(lattice) plot(x,y) z <- rnorm(5, 1, 0.5) dataframe <-
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