Home > Archive > Tcl > March 2004 > What is the values returned by tktable bbox?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
What is the values returned by tktable bbox?
|
|
| George Petasis 2004-03-27, 12:26 am |
| I am trying to locate the coordinates of a tktable cell
(in pixels) but I really cannot understand what bbox
returns. I am trying for example the cells in the title row,
but the results are identical for all title cells (even the x,y values).
So, how can I find the coordinates of a cell, either within the widget
or in screen coordinates to place a tooltip on it??????
George
| |
| Jeff Hobbs 2004-03-27, 12:27 am |
| George Petasis wrote:
> I am trying to locate the coordinates of a tktable cell
> (in pixels) but I really cannot understand what bbox
> returns. I am trying for example the cells in the title row,
> but the results are identical for all title cells (even the x,y values).
>
> So, how can I find the coordinates of a cell, either within the widget
> or in screen coordinates to place a tooltip on it??????
I'm not sure you are looking at it right, because it seems
to be working as expected for me:
(temp) 49 % source C:/Tcl/demos/Tktable/debug.tcl
Tktable v2.8 loaded
Table is .t with array t
(temp) 50 % .t bbox -4,-1
52 19 56 17
(temp) 51 % .t bbox -3,-1
52 36 56 17
It returns {x y w h}, so most even cells have w and h the same,
and x or y only changes as you change row / col.
--
Jeff Hobbs, The Tcl Guy
http://www.ActiveState.com/, a division of Sophos
| |
| Georgios Petasis 2004-03-27, 12:27 am |
| Why are you using negative indexes?
Isn't the second cell on the horizontal title row
the 0,1 cell? bbox returns for me the exact same
coordinates for all 0,* cells in my table...
George
"Jeff Hobbs" <jeffh@activestate.com> wrote in message
news:406304E2.4010202@activestate.com...
> George Petasis wrote:
>
>
> I'm not sure you are looking at it right, because it seems
> to be working as expected for me:
>
> (temp) 49 % source C:/Tcl/demos/Tktable/debug.tcl
> Tktable v2.8 loaded
> Table is .t with array t
> (temp) 50 % .t bbox -4,-1
> 52 19 56 17
> (temp) 51 % .t bbox -3,-1
> 52 36 56 17
>
> It returns {x y w h}, so most even cells have w and h the same,
> and x or y only changes as you change row / col.
>
> --
> Jeff Hobbs, The Tcl Guy
> http://www.ActiveState.com/, a division of Sophos
| |
| Jeff Hobbs 2004-03-27, 12:27 am |
| Georgios Petasis wrote:
> Why are you using negative indexes?
> Isn't the second cell on the horizontal title row
> the 0,1 cell? bbox returns for me the exact same
> coordinates for all 0,* cells in my table...
Indices are whatever you want them to be, depending on what
you told the table to start counting at. I used the demo
example so we could work from the same code to see that it
does work.
--
Jeff Hobbs, The Tcl Guy
http://www.ActiveState.com/, a division of Sophos
|
|
|
|
|