gtk2 intf: improved cell renderer test for drawn items from Andrew Haines

git-svn-id: trunk@10122 -
This commit is contained in:
mattias 2006-10-28 15:43:23 +00:00
parent 0d6f320556
commit 882a5c5696

View File

@ -102,8 +102,12 @@ begin
// get itemindex and area
ItemIndex:=0;
if GTK_IS_TREE_VIEW(Widget) then begin
gtk_tree_view_get_path_at_pos(PGtkTreeView(Widget),cell_area^.x, cell_area^.y, ItemPath, column, nil, nil);
if ItemPath <> nil then
//check the four possible corners of the cell
if gtk_tree_view_get_path_at_pos(PGtkTreeView(Widget),cell_area^.x, cell_area^.y, ItemPath, column, nil, nil)
or gtk_tree_view_get_path_at_pos(PGtkTreeView(Widget),cell_area^.x, cell_area^.y+cell_area^.height, ItemPath, column, nil, nil)
or gtk_tree_view_get_path_at_pos(PGtkTreeView(Widget),cell_area^.x+cell_area^.width, cell_area^.y, ItemPath, column, nil, nil)
or gtk_tree_view_get_path_at_pos(PGtkTreeView(Widget),cell_area^.x+cell_area^.width, cell_area^.y+cell_area^.height, ItemPath, column, nil, nil)
then
ItemIndex := StrToInt(gtk_tree_path_to_string(ItemPath));
end;