Skip to content
Back to formatted view

Raw Message

Message-ID: <CAJeYpE_G=eTLTmOxtOTFhUNQ3LJusrGbwecpu1yXGBg3T47S4g@mail.gmail.com>
Date: 2016-04-29T17:42:07Z
From: Dalthorp, Daniel
Subject: tcltk: click and return table cell index

I'm struggling mightily with what should be a simple task...when a user
clicks on a cell in a tcltk table widget, I need to know which cell was
clicked.

One idea that gives a cryptic error:
tkbind(table1, "<Button-1>", function(x, y){
  tcl(table1, "index", x, y)
}

# x, y give pixel coordinates; "index" should give cell coordinates, but
format must be correct

I get an error message:

wrong # args: should be ".25.1 index <index> ?row|col?".

To which I respond, "Yes, I know I have the format wrong, but how can I
make sense of THAT?"

Does anyone know a simple fix?

Much appreciated!

-Dan

-- 
Dan Dalthorp, PhD
USGS Forest and Rangeland Ecosystem Science Center
Forest Sciences Lab, Rm 189
3200 SW Jefferson Way
Corvallis, OR 97331
ph: 541-750-0953
ddalthorp at usgs.gov

	[[alternative HTML version deleted]]