VOOZH about

URL: https://www.geeksforgeeks.org/python/wxpython-two-step-creation-wx-treectrl/

⇱ wxPython - Two step creation wx.TreeCtrl - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

wxPython - Two step creation wx.TreeCtrl

Last Updated : 1 Feb, 2022

In this article we are going to learn that how can we create a Tree Control using two step creation. In order to do that we will use Create() method in wx.TreeCtrl class. Basically, we will initialize tree control using TreeCtrl() constructor with empty parentheses and then we will use Create() method and attributes to associate with Tree Control.

Syntax:

wx.TreeCtrl.Create(self, parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=TR_DEFAULT_STYLE, validator=DefaultValidator, name=TreeCtrlNameStr)

Parameters:

ParameterTypeDescription
parentwx.Windowparent window/frame for Tree Control.
idwx.WindowIDwidget identifier to be associated with Tree Control
poswx.Pointposition where to put Tree Control.
sizewx.Sizesize of the Tree Control widget
stylelongstyle for Tree Control.
validatorwx.ValidatorValidator associated withTree Control.
namestringName of Tree Control.

Code Example:

Output:

👁 Image
Comment