wx.dataview.DataViewTreeCtrl — wxPython Phoenix 4.2.3 documentation

phoenix_title wx.dataview.DataViewTreeCtrl

This class is a wx.dataview.DataViewCtrl which internally uses a wx.dataview.DataViewTreeStore and forwards most of its API to that class.

Additionally, it uses a wx.ImageList to store a list of icons.

The main purpose of this class is to provide a simple upgrade path for code using wx.TreeCtrl.

styles Window Styles

This class supports the following styles:

See wx.dataview.DataViewCtrl for the list of supported styles.

events Events Emitted by this Class

Event macros for events emitted by this class:

See wx.dataview.DataViewCtrl for the list of events emitted by this class.

Added in version 2.9.0.


class_hierarchy Class Hierarchy

Inheritance diagram for class DataViewTreeCtrl:

appearance Control Appearance


wxMSW

wxMSW

wxMAC

wxMAC

wxGTK

wxGTK


method_summary Methods Summary


property_summary Properties Summary


api Class API

class wx.dataview.DataViewTreeCtrl(DataViewCtrl)

Possible constructors:

DataViewTreeCtrl() -> None

DataViewTreeCtrl(parent, id=ID_ANY, pos=DefaultPosition,
                 size=DefaultSize, style=DV_NO_HEADER|DV_ROW_LINES,
                 validator=DefaultValidator) -> None

This class is a DataViewCtrl which internally uses a DataViewTreeStore and forwards most of its API to that class.


Methods

__init__(self, *args, **kw)

overload Overloaded Implementations:



__init__ (self)

Default constructor.

Return type:

None



__init__ (self, parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=DV_NO_HEADER|DV_ROW_LINES, validator=DefaultValidator)

Constructor.

Calls Create .

Parameters:
Return type:

None





AppendContainer(self, parent, text, icon=-1, expanded=-1, data=None)

Appends a container to the given parent.

Parameters:
Return type:

wx.dataview.DataViewItem



AppendItem(self, parent, text, icon=-1, data=None)

Appends an item to the given parent.

Parameters:
Return type:

wx.dataview.DataViewItem



Create(self, parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=DV_NO_HEADER | DV_ROW_LINES, validator=DefaultValidator)

Creates the control and a wx.dataview.DataViewTreeStore as its internal model.

The default tree column created by this method is an editable column using wx.dataview.DataViewIconTextRenderer as its renderer.

Parameters:
Return type:

bool



DeleteAllItems(self)

Calls the identical method from wx.dataview.DataViewTreeStore.

Return type:

None



DeleteChildren(self, item)

Calls the identical method from wx.dataview.DataViewTreeStore.

Parameters:

item (wx.dataview.DataViewItem)

Return type:

None



DeleteItem(self, item)

Calls the identical method from wx.dataview.DataViewTreeStore.

Parameters:

item (wx.dataview.DataViewItem)

Return type:

None



GetChildCount(self, parent)

Calls the identical method from wx.dataview.DataViewTreeStore.

Parameters:

parent (wx.dataview.DataViewItem)

Return type:

int



static GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL)
Parameters:

variant (WindowVariant)

Return type:

VisualAttributes



GetImageList(self)

Returns the image list.

Return type:

ImageList



GetItemData(self, item)

Calls the identical method from wx.dataview.DataViewTreeStore.

Parameters:

item (wx.dataview.DataViewItem)

Return type:

ClientData



GetItemExpandedIcon(self, item)

Calls the identical method from wx.dataview.DataViewTreeStore.

Parameters:

item (wx.dataview.DataViewItem)

Return type:

Icon



GetItemIcon(self, item)

Calls the identical method from wx.dataview.DataViewTreeStore.

Parameters:

item (wx.dataview.DataViewItem)

Return type:

Icon



GetItemParent(self, item)

Returns the item’s parent.

Parameters:

item (wx.dataview.DataViewItem)

Return type:

wx.dataview.DataViewItem

Added in version 4.1/wxWidgets-3.1.6.



GetItemText(self, item)

Calls the identical method from wx.dataview.DataViewTreeStore.

Parameters:

item (wx.dataview.DataViewItem)

Return type:

str



GetNthChild(self, parent, pos)

Calls the identical method from wx.dataview.DataViewTreeStore.

Parameters:
Return type:

wx.dataview.DataViewItem



GetStore(self)

Returns the store.

Return type:

wx.dataview.DataViewTreeStore



InsertContainer(self, parent, previous, text, icon=-1, expanded=-1, data=None)

Calls the same method from wx.dataview.DataViewTreeStore but uses an index position in the image list instead of a wx.Icon.

Parameters:
Return type:

wx.dataview.DataViewItem



InsertItem(self, parent, previous, text, icon=-1, data=None)

Calls the same method from wx.dataview.DataViewTreeStore but uses an index position in the image list instead of a wx.Icon.

Parameters:
Return type:

wx.dataview.DataViewItem



IsContainer(self, item)

Returns True if item is a container.

Parameters:

item (wx.dataview.DataViewItem)

Return type:

bool



PrependContainer(self, parent, text, icon=-1, expanded=-1, data=None)

Calls the same method from wx.dataview.DataViewTreeStore but uses an index position in the image list instead of a wx.Icon.

Parameters:
Return type:

wx.dataview.DataViewItem



PrependItem(self, parent, text, icon=-1, data=None)

Calls the same method from wx.dataview.DataViewTreeStore but uses an index position in the image list instead of a wx.Icon.

Parameters:
Return type:

wx.dataview.DataViewItem



SetImageList(self, imagelist)

Sets the image list.

Parameters:

imagelist (wx.ImageList)

Return type:

None



SetItemData(self, item, data)

Calls the identical method from wx.dataview.DataViewTreeStore.

Parameters:
Return type:

None



SetItemExpandedIcon(self, item, icon)

Calls the identical method from wx.dataview.DataViewTreeStore.

Parameters:
Return type:

None



SetItemIcon(self, item, icon)

Calls the identical method from wx.dataview.DataViewTreeStore.

Parameters:
Return type:

None



SetItemText(self, item, text)

Calls the identical method from wx.dataview.DataViewTreeStore.

Parameters:
Return type:

None


Properties

ImageList

See GetImageList and SetImageList



Store

See GetStore