wxTreeListCtrl - InsertColumnInfo

I can't find documenation for wxTreeListCtrl.InsertColumnInfo.

Can anyone point me to it? In fact is there a way/tool to find what attributes are expected in a function call (besides looking at the source?)?

I assumed the format would be the same as for wxListCtrl, i.e. list.InsertColumnInfo(colNo, info).

See you
Werner

Werner F. Bruhin wrote:

I can't find documenation for wxTreeListCtrl.InsertColumnInfo.

Can anyone point me to it? In fact is there a way/tool to find what attributes are expected in a function call (besides looking at the source?)?

No, but I am working on a way to auto-generate that info.

I assumed the format would be the same as for wxListCtrl, i.e. list.InsertColumnInfo(colNo, info).

It is, except info is a wxTreeListColumnInfo object.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Hi Robin,

Robin Dunn wrote:

Werner F. Bruhin wrote:

I can't find documenation for wxTreeListCtrl.InsertColumnInfo.

Can anyone point me to it? In fact is there a way/tool to find what attributes are expected in a function call (besides looking at the source?)?

No, but I am working on a way to auto-generate that info.

Looking forward to it.

I assumed the format would be the same as for wxListCtrl, i.e. list.InsertColumnInfo(colNo, info).

It is, except info is a wxTreeListColumnInfo object.

I did use a wxTreeListColumnInfo object.

Some code snippet:
            info = wxTreeListColumnInfo()
            info.m_mask = wxLIST_MASK_TEXT | wxLIST_MASK_IMAGE | wxLIST_MASK_FORMAT
            info.m_image = -1
           
                info.m_text = self.colLabels # string e.g. 'Vintage'
                info.m_format = self.colAlign # e.g. wxTR_ALIGN_RIGHT
                info.m_width = self.tlcColSize # e.g. 100
                self.tree.InsertColumnInfo(x, info)

I am getting the following error on the first iteration when x = 0.

wxPyAssertionError: C++ assertion "wxAssertFailure" failed in contrib/gizmos/treelistctrl.cpp(1431): Invalid column index

I have no problems using self.tree.AddColumn(x, self.colLabels), but would like to use InsertColumnInfo to do the align and size stuff.

See you
Werner

Werner F. Bruhin wrote:

I have no problems using self.tree.AddColumn(x, self.colLabels), but would like to use InsertColumnInfo to do the align and size stuff.

Does AddColumnInfo(info) work?

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Robin,

Robin Dunn wrote:

Werner F. Bruhin wrote:

I have no problems using self.tree.AddColumn(x, self.colLabels), but would like to use InsertColumnInfo to do the align and size stuff.

Does AddColumnInfo(info) work?

Not really, as the column headers don't show.

I attached a small test program, you just need to uncomment the approriate line.

Thanks for any help on making this work.

See you
Werner

treelistctrlproblem.py (2.88 KB)

Werner F. Bruhin wrote:

Robin,

Robin Dunn wrote:

Werner F. Bruhin wrote:

I have no problems using self.tree.AddColumn(x, self.colLabels), but would like to use InsertColumnInfo to do the align and size stuff.

Does AddColumnInfo(info) work?

Not really, as the column headers don't show.

I attached a small test program, you just need to uncomment the approriate line.

This works:

         for x in range(len(self.colLabels)):
             info.SetText(self.colLabels)
             info.SetAlignment(self.colAlign)
             info.SetWidth( self.tlcColSize)
             self.treeList.AddColumnInfo(info)

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Robin,

Robin Dunn wrote:

Werner F. Bruhin wrote:

Robin,

Robin Dunn wrote:

Werner F. Bruhin wrote:

I have no problems using self.tree.AddColumn(x, self.colLabels), but would like to use InsertColumnInfo to do the align and size stuff.

Does AddColumnInfo(info) work?

Not really, as the column headers don't show.

I attached a small test program, you just need to uncomment the approriate line.

This works:

        for x in range(len(self.colLabels)):
            info.SetText(self.colLabels)
            info.SetAlignment(self.colAlign)
            info.SetWidth( self.tlcColSize)
            self.treeList.AddColumnInfo(info)

Thanks, that works great.

See you
Werner