wxPython – GetFocusedItem() method in wx.TreeCtrl
In this article, we are going to learn about GetFocusedItem() method associated with wx.TreeCtrl class of wxPython module. The GetFocusedItem() function is used in order to return the focused item. It returns the item last clicked or otherwise selected. No parameters are required by GetFocusedItem() method.
Unlike GetSelection(), it can be used whether the control has the TR_MULTIPLE style.
Return Type: wx.TreeItemId
Parameters: No parameters
In the below program we will return if the item is valid or not. Also, the wx.TreeItemId object is returned.
Valid Item <wx._core.TreeItemId object at 0x000001DAED4141F8>