TreeItemId.IsOK

Hi all,

I'm looking through code on lazy tree controls:
http://wiki.wxpython.org/index.cgi/TreeControls#head-a0735982d5749bfd4d11a0fef976b07553e63c02

The code contains this fragment:

   def onExpand(self, event):
        '''onExpand is called when the user expands a node on the tree
        object. It checks whether the node has been previously expanded. If
        not, the extendTree function is called to build out the node, which
        is then marked as expanded.'''

        # get the wxID of the entry to expand and check it's validity
        itemID = event.GetItem()
        if not itemID.IsOk():
            itemID = self.tree.GetSelection()

        # Remainder of function snipped.

The onExpand function is bound to the EVT_TREE_ITEM_EXPANDING event.

My question is: Under what circumstances might itemID.IsOK() be False?

I have seen the docs at
http://www.wxwidgets.org/manuals/2.6.1/wx_wxtreectrl.html which say
that GetNextChild() will return an invalid tree item if there are no
more children. But for code triggered by a tree expand event, can the
item ever be invalid?

···

--
John.