CheckBox in the TreeControl

In the TreeControl, iam having a checkBox, i want to check or uncheck ,only
if i click the checkbox image....
if i click anywhereelse it should not check or uncheck
the below is my code.....it is always goes to the else part.....it is not
coming to the if part
I dunno the mistake i made....
Pls tell me the mistake or anyother way to click only the check or uncheck
the checkbox.

def OnLeftMouseButtonUp(self, evt):
    clickedAreaInTree = self.testRunnerTree.HitTest(evt.GetPosition())
    if clickedAreaInTree[1] == wxTREE_HITTEST_ONITEMICON:
       wxMessageBox("You have clicked the check Box")
    else:
       wxMessageBox("You have not clicked the check box ")

Regards
Bala

bala wrote:

In the TreeControl, iam having a checkBox, i want to check or uncheck ,only
if i click the checkbox image....
if i click anywhereelse it should not check or uncheck
the below is my code.....it is always goes to the else part.....it is not
coming to the if part
I dunno the mistake i made....
Pls tell me the mistake or anyother way to click only the check or uncheck
the checkbox.

def OnLeftMouseButtonUp(self, evt):
    clickedAreaInTree = self.testRunnerTree.HitTest(evt.GetPosition())
    if clickedAreaInTree[1] == wxTREE_HITTEST_ONITEMICON:
       wxMessageBox("You have clicked the check Box")
    else:
       wxMessageBox("You have not clicked the check box ")

Platform, version and small sample app please.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!