views:

114

answers:

2

As per the title, is this possible?

By tri-state, I mean the parent node is:

  • Checked if all children are checked
  • Unchecked if all children are unchecked
  • Grey/Filled if some children are checked

I have used them previously in C# but cannot find an equivalent control/implementation for wxPython.

A: 

Did you look at wx.lib.agw.CustomTreeCtrl?

I'm not sure it does tri-state out of the box, but it's written in Python, so it should be quite easy to extend it.

Frank Niessink
Thanks - can you point me at any examples of extending it?
Noah
Sure, wx.lib.agw.HyperTreeList is an extension of CustomTreeCtrl that adds columns.
Frank Niessink
A: 
# --------------------------------------------------------------------------------- #
# CUSTOMTREECTRL wxPython IMPLEMENTATION
# Inspired By And Heavily Based On wxGenericTreeCtrl.
#
# Andrea Gavana, @ 17 May 2006
# Latest Revision: 14 Apr 2010, 12.00 GMT
#
#
# TODO List
#
# Almost All The Features Of wx.TreeCtrl Are Available, And There Is Practically
# No Limit In What Could Be Added To This Class. The First Things That Comes
# To My Mind Are:
#
# 1. Implement The Style TR_EXTENDED (I Have Never Used It, But It May Be Useful).
#
# 2. Add Support For 3-State CheckBoxes (Is That Really Useful?).

That "3-State CheckBoxes" does not finished yet!

PongZhong