TreeView.getPathAtPos

Finds the path at the point (x, y), relative to bin_window coordinates (please see TreeView.getBinWindow). That is, x and y are relative to an events coordinates. x and y must come from an event on the tree_view only where `event->window == gtk_tree_view_get_bin_window ()`. It is primarily for things like popup menus. If path is non-NULL, then it will be filled with the gtk.TreePath at that point. This path should be freed with TreePath.free. If column is non-NULL, then it will be filled with the column at that point. cell_x and cell_y return the coordinates relative to the cell background (i.e. the background_area passed to CellRenderer.render). This function is only meaningful if tree_view is realized. Therefore this function will always return FALSE if tree_view is not realized or does not have a model.

For converting widget coordinates (eg. the ones you get from GtkWidget::query-tooltip), please see TreeView.convertWidgetToBinWindowCoords.

class TreeView
bool
getPathAtPos
(
int x
,
int y
,,,
out int cellX
,
out int cellY
)

Parameters

x int

The x position to be identified (relative to bin_window).

y int

The y position to be identified (relative to bin_window).

path TreePath

A pointer to a gtk.TreePath pointer to be filled in, or NULL

column TreeViewColumn

A pointer to a gtk.TreeViewColumn pointer to be filled in, or NULL

cellX int

A pointer where the X coordinate relative to the cell can be placed, or NULL

cellY int

A pointer where the Y coordinate relative to the cell can be placed, or NULL

Return Value

Type: bool

TRUE if a row exists at that coordinate.