[pygtk] Get cell position of GtkTreeView from pixel position

Johannes Bauer dfnsonfsduifb at gmx.de
Thu Oct 28 03:43:13 WST 2010


Hi there,

starting out with widget coordinates, how do I determine the cell X and
Y position of a GtkTreeView from that? I got this far: using
tv.widget_to_tree_coords(x, y) I converted the widget coordinates to
tree coordinates. Then I used tv.get_path_at_pos(x, y) which yields a
four-tuple:

(path, col, x, y)

Path is the row index I'm looking for. Col is - in my case - always the
column 0 (no matter where the coordinates are). x and y seem to be
relative to the cell, which in my case isn't really useful.

So how do I also determine the column index?

Kind regards,
Johannes


More information about the pygtk mailing list