(int, int) = HitTest(x,y)

Determines which tree view item, if any, is at a specified position.


x,y : point

The point to test.

Return Value

The result is a tuple of (flags, hItem). flags may be a combination of the following values:

Value Description
commctrl.TVHT_ABOVEAbove the client area.
commctrl.TVHT_BELOWBelow the client area.
commctrl.TVHT_NOWHEREIn the client area, but below the last item.
commctrl.TVHT_ONITEMOn the bitmap or label associated with an item.
commctrl.TVHT_ONITEMBUTTONOn the button associated with an item.
commctrl.TVHT_ONITEMICONOn the bitmap associated with an item.
commctrl.TVHT_ONITEMINDENTIn the indentation associated with an item.
commctrl.TVHT_ONITEMLABELOn the label (string) associated with an item.
commctrl.TVHT_ONITEMRIGHTIn the area to the right of an item.
commctrl.TVHT_ONITEMSTATEICONOn the state icon for a tree view item that is in a user-defined state.
commctrl.TVHT_TOLEFTTo the left of the client area.
commctrl.TVHT_TORIGHTTo the right of the client area.