void test12052019Frame::OnTreeCtrl1ItemActivated(wxTreeEvent& event)
{
//TreeCtrl1 is my tree
//when I click on any option of my tree
//it activates a wxMessageBox with the label
//of the option selected...
//just let go your imagination :)
//A youtube video will follow.
wxString thelabel;
wxTreeItemId test3;
test3 = TreeCtrl1->GetSelection();//id of the item selected
thelabel = TreeCtrl1->GetItemText(test3);//extract associated text
wxMessageBox(thelabel); //shazam !
}
就我的二十几岁:
我一直在寻找与C++ /WxWiWes相同的解决方案,持续2天。在我发现了一个很好的例子:
我在wxSmith(RAD工具)中使用代码块。Ubuntu仿生
来自windows的Ssh&导出显示和代码块
这是这个特定事件的代码。。。在
Working example on youtube
您没有正确绑定回调。您目前需要:
但是第三个参数是
^{pr2}$source
;id
是第四个参数。所以,把它改成:这样,您将在
OnAdd
函数中得到的event
参数将是tree
实例,该实例具有可用的GetItem
方法。在完整示例:
相关问题 更多 >
编程相关推荐