开发者

Tree view GUI widget/gui library that can do multiple icons?

Screenshot

I'm looking to recreate this in Python; I can't find a library that seems to have what I need. Are there any GUI libraries that might possib开发者_高级运维ly have this? - I have scoured wxWidgets (which is my preferred gui library) but they have nothing similar.

I have a script already that uses a standard wxTreeCtrl but it has no provisions for adding additional icons at the tail end like this screen shot.

If no pre-existing gui library exists, any tips for my first steps in trying to create it myself?


you have few options

  1. Use wx.lib.customtreectrl.CustomTreeCtrl
    AppendItem of CustomTreeCtrl can take any wx widget, which is shown at end, so you can use that to affect e.g. tree.AppendItem(root, "item1", wnd=yourImageControl)

  2. Use wx.gizmos.TreeListCtrl, you can have icons in separate columns and tree in first column

  3. You can use wx.lib.mvctree , and supply your own Painter class or derive class from TreePainter, and override Paint method

  4. Or most complex but most satisfying way is to write your own tree control, and if you have long term usage for such a control and you may need more custom changes, it will be best way and won't be much difficult. See mvtree for inspiration or customize that.


Instead of CustomTreeCtrl, I'd look into HyperTreeList. It is based on CustomTreeCtrl, but adds support for multiple columns. I'm not sure if it supports multiple icons in one column out of the box though.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜