nana::gui::listbox throws

Jul 4, 2014 at 11:41 AM
Edited Jul 4, 2014 at 11:42 AM
Hi,Jinhao.
Could you tell me please why in this small app I get an exception,clicking on the second header:
#include <nana/gui/wvl.hpp>
#include <nana/gui/place.hpp>
#include <nana/gui/widgets/menu.hpp>
#include <nana/gui/widgets/listbox.hpp>

int main()
{
    nana::gui::form form(nana::gui::API::make_center(860,480));
    form.caption(L"Clinic Manager(Незарегистрированая версия)");
    nana::gui::place layout(form);
    nana::gui::listbox doctors(form);
    doctors.append_header(L"Ф.И.О",128u);
    doctors.append_header(L"Должность",200u);
    doctors.append_header(L"Часы приема",768u);
    doctors.append_item(0,L"Иванов И.И.");
    doctors.append_item(0,L"Иванов И.И.");
    layout.div("<field>");
    layout.field("field") << doctors;
    layout.collocate();
    form.show();
    nana::gui::exec();
}
Oh, I am using nana 0.5.2 c++11
Coordinator
Jul 4, 2014 at 9:46 PM
Thank you for reporting this bug, and the bug will be shown up in new coming version 0.7, or download the latest code from the code repo. The nana version you use is a bit outdate, when you use the latest nana, your code should be modified for some changes.
    doctors.append_item(0,L"Иванов И.И.");
    doctors.append_item(0,L"Иванов И.И.");
To
    auto cat = doctors.at(0);   //Category 0
   
    cat.push_back(L"Иванов И.И.");
    cat.push_back(L"Иванов И.И.");