[R] help: how to use tkevent.generate(...)

wu sz r.shengzhe at gmail.com
Tue Jul 12 12:28:09 CEST 2005


Hello,

I use package "tcltk" to do some GUI programming, and want to find a
function which can do the operation "click a button", 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




More information about the R-help mailing list