how to access the listbox item?
filling out the list is nothing complicated. HANDLE const hFind = FindFirstFileA((LPCSTR)FPUPath, &wfdfpu); if (INVALID_HANDLE_VALUE != hFind) { char num[16]; int i = 0; do { sprintf(num, "%d", i); data_list.at(0).append({ num, &wfdfpu.cFileName[0] }); listrule.push_back(&wfdfpu.cFileName[0]); i++; } while (NULL != FindNextFileA(hFind, &wfdfpu));
FindClose(hFind);
}
but I can’t find a solution to how to access the contents of the column. forced to duplicate the list, and get the contents by the index of the selected element already from it auto index = data_list.selected().at(0); for (int i = 0; i < listrule.size(); ++i) { if (index.item == i) { long sPos; while ((sPos = myStr.find(FPU, 5)) != string::npos) { myStr.replace(sPos, 5, (string)listrule[i]); yes = true; } break; } } I did not find anything on the documentation. If possible, give a code example to get the contents of the selected column in a row
Take a look at this page, there's an example at the bottom. https://errorflynn.github.io/nana-docs/ The site is a work in progress, but the listbox page is complete.
<<ErrorFlynn Thanks for the link, but in the example there are only 2 elements known in advance. I have more than 100 in the list, and in any programming language, the contents of the element are obtained by index. The structure with categories is not clear here, and how to index them is not yet clear.
OK. figured out ..))) somewhere like this, this is solved: auto str = data_list.at(0).at(data_list.selected().at(0).item).text(1);