VOOZH about

URL: https://www.geeksforgeeks.org/python/wxpython-getboundingrect-method-in-wx-treectrl/

⇱ wxPython - GetBoundingRect() method in wx.TreeCtrl - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

wxPython - GetBoundingRect() method in wx.TreeCtrl

Last Updated : 25 Nov, 2020

In this article, we are going to learn about GetBoundingRect() method in wx.TreeCtrl. GetBoundingRect() returns the rectangle bounding the item. If textOnly is True, only the rectangle around the item’s label will be returned, otherwise, the item’s image is also taken into account. The return value may be None if the rectangle was not successfully retrieved, such as if the item is currently not visible.

GetBoundingRect() takes two arguments item and textOnly.

Syntax:  

wx.TreeCtrl.GetBoundingRect(self, item, textOnly)

Parameters:

ParameterTypeDescription
itemwx.TreeItemId                      item that we want to ensure to be visible.
textOnly                        boolean If textOnly is True, only the rectangle around the item’s label will be returned, otherwise the item’s image is also taken into account.

Output:

(0, 0 , 10, 10)
👁 Image
Comment