Skip to content
Prev 360543 / 398503 Next

tcltk: click and return table cell index

Dear Daniel,

Try 

tkbind(table1, "<Button-1>", function(){
     res <- try(tclvalue(tkindex(table1, "active")), silent=TRUE)
   if (inherits(res, "try-error")) print (NULL)
   else print(res)
})

I put in the calls to print() so that you could see how it works.

I hope this helps,
 John

-----------------------------
John Fox, Professor
McMaster University
Hamilton, Ontario
Canada L8S 4M4
Web: socserv.mcmaster.ca/jfox