code: def OnSelectCard(self, event):
          
          item = event.GetItem()
          if item:
              itemdata = self.readertreepanel.cardtreectrl.GetItemPyData(item)
              if isinstance(itemdata, smartcard.Card.Card):
                  self.dialogpanel.OnSelectCard(itemdata)
              else:
                  self.dialogpanel.OnDeselectCard(itemdata)
docs: Called when the user selects a card in the tree.