如何在wxwidgets中向树控件添加复选框 [英] How to add checkboxes to the tree control in wxwidgets
本文介绍了如何在wxwidgets中向树控件添加复选框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
实际上我用wxTreeCtrl类创建了一个树控件,但我无法获得该ctrl的复选框。我已尝试但没有用,所以你会告诉我如何在wxWidgets中为treectrl添加复选框。
我尝试了什么:
Actually I have created one tree control with wxTreeCtrl class,but I cant get the checkboxes to that ctrl. I have tried in but no use, so will u plz tell me how to add checkboxes to that treectrl in wxWidgets.
What I have tried:
wxTreeItemId rootId = tree->AddRoot("Root");
wxTreeItemId child2Id = tree->AppendItem(rootId, "Child1");
//tree->AppendItem(new wxCheckBox(this, -1, wxT("")), 0, wxEXPAND);
tree->AppendItem(child2Id, "mark1");
tree->AppendItem(child2Id, "mark2");
tree->ExpandAll();
推荐答案
在示例概述您可以找到示例应用程序的链接,这些应用程序也会为您演示其他内容。
In the Sample overview of wxwiget you find a link to sample applications which also demonstrates other stuff for you.
这篇关于如何在wxwidgets中向树控件添加复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文