int main()
{
using namespace nana;
form fm;
listbox lb(fm, nana::rectangle(10, 10, 280, 120));
auto cat = lb.at(0);
if (cat.begin() == cat.end())
std::wcout << ("true ");
else
std::wcout << ("false ");
std::wcout << "\n";
lb.append_header( ("Name"), 100);
lb.append_header( ("Gender"), 60);
lb.append_header( ("Age"), 60);
//lb.resolver(resolver()); //Pass the user defined resolver to the listbox
person pr;
pr.name = ("Peter");
pr.gender = true;
pr.age = 10;
lb.at(0).append (pr); //person to item. resolver::decode() is required
person prr;
lb.at(0).at(0).resolve_to( prr); //item to person. resolver::encode() is required
std::cout << pr << "\n";
std::cout << prr << "\n";
fm.show();
exec();
}
我正在尝试在列表中检查数据 我尝试了 selected()/checked() 函数,但我不确定如何使用它们,因为我对此了解不多
这是 Nanapro gui 库,带有 c++14