*********** wx.Treebook *********** Inheritance diagram for `wx.Treebook`: | .. inheritance-diagram:: wx.Treebook | Description =========== This class is an extension of the `wx.Notebook `_ class that allows a tree structured set of pages to be shown in a control. A classic example is a netscape preferences dialog that shows a tree of preference sections on the left and select section page on the right. To use the class simply create it and populate with pages using `InsertPage `_, `InsertSubPage <#InsertSubPage>`_, `AddPage `_, `AddSubPage <#AddSubPage>`_ . If your tree is no more than 1 level in depth then you could simply use `AddPage `_ and `AddSubPage <#AddSubPage>`_ to sequentially populate your tree by adding at every step a page or a subpage to the end of the tree. .. seealso:: `wx.Notebook `_ , `wx.TreebookEvent <../Events/wx.TreebookEvent.html>`_ , `wx.ImageList `_ Derived From ^^^^^^^^^^^^^ * `wx.Control `_ * `wx.Window `_ * `wx.EvtHandler `_ * `wx.Object `_ Event Handling ^^^^^^^^^^^^^^ ================================================== ================================================== Event Name Description ================================================== ================================================== wx.EVT_TREEBOOK_PAGE_CHANGED(id, func) The page selection was changed. Processes a ``wx.wxEVT_COMMAND_TREEBOOK_PAGE_CHANGED`` event. wx.EVT_TREEBOOK_PAGE_CHANGING(id, func) The page selection is about to be changed. Processes a ``wx.wxEVT_COMMAND_TREEBOOK_PAGE_CHANGING`` event. This event can be vetoed. wx.EVT_TREEBOOK_NODE_COLLAPSED(id, func) The page node is going to be collapsed. Processes a ``wx.wxEVT_COMMAND_TREEBOOK_NODE_COLLAPSED`` event. wx.EVT_TREEBOOK_NODE_EXPANDED(id, func) The page node is going to be expanded. Processes a ``wx.wxEVT_COMMAND_TREEBOOK_NODE_EXPANDED`` event. ================================================== ================================================== Methods Summary ^^^^^^^^^^^^^^^ * `__init__ <#__init__>`_ * `AddSubPage <#AddSubPage>`_ * `CollapseNode <#CollapseNode>`_ * `ExpandNode <#ExpandNode>`_ * `GetPageParent <#GetPageParent>`_ * `GetTreeCtrl <#GetTreeCtrl>`_ * `InsertSubPage <#InsertSubPage>`_ * `IsNodeExpanded <#IsNodeExpanded>`_ Properties Summary ^^^^^^^^^^^^^^^^^^ * `TreeCtrl <#TreeCtrl>`_ Class API ========= Methods ^^^^^^^ .. method:: __init__(parent, id, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.BK_DEFAULT, name="") Creates an empty `wx.Treebook` control. **Parameters:** * `parent` (`wx.Window `_) * `id` (int) * `pos` (`wx.Point `_) * `size` (`wx.Size `_) * `style` (long) * `name` (string) | **Returns:** `wx.Treebook `_ -------- .. method:: AddSubPage(page, text, bSelect=False, imageId=wx.NOT_FOUND) Adds a new child-page to the last top-level page. ``None`` could be specified for page to create an empty page. **Parameters:** * `page` (`wx.Window `_) * `text` (string) * `bSelect` (bool) * `imageId` (int) | **Returns:** `bool` -------- .. method:: CollapseNode(pageId) Shortcut for `ExpandNode <#ExpandNode>`_ (pageId, ``False``). **Parameters:** * `pageId` (long) | **Returns:** `bool` -------- .. method:: ExpandNode(pageId, expand=True) Expands (collapses) the `pageId` node. Returns the previous state. May generate page changing events (if selected page is under the collapsed branch, then its parent is autoselected). **Parameters:** * `pageId` (long) * `expand` (bool) | **Returns:** `bool` -------- .. method:: GetPageParent(page) Returns the parent page of the given one or ``wx.NOT_FOUND`` if this is a top-level page. **Parameters:** * `page` (long) | **Returns:** `int` -------- .. method:: GetTreeCtrl() `No docstrings found for this method.` -------- .. method:: InsertSubPage(pagePos, page, text, bSelect=False, imageId=wx.NOT_FOUND) Inserts a sub page under the specified page. ``None`` could be specified for page to create an empty page. **Parameters:** * `pagePos` (long) * `page` (`wx.Window `_) * `text` (string) * `bSelect` (bool) * `imageId` (int) | **Returns:** `bool` -------- .. method:: IsNodeExpanded(pageId) Gets the `pageId` page state -- whether it is expanded or collapsed **Parameters:** * `pageId` (long) | **Returns:** `bool` -------- Properties ^^^^^^^^^^ .. attribute:: TreeCtrl See `GetTreeCtrl <#GetTreeCtrl>`_