cnjinhao / nana

a modern C++ GUI library

Home Page:https://nana.acemind.cn

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

treebox::clear failed

uuiid opened this issue · comments

class tree : public nana::form
{
    nana::treebox p_tree;
    nana::place p_layout;
    nana::menu p_menu;

public:
    tree() : 
    p_tree(*this),
     p_layout(*this),
     p_menu()
    {
        p_layout.div("<tree>");

        auto tset = p_tree.insert("root", "root");
        tset.append("1", "1");
        tset.append("2", "2");
        tset.append("3", "3");
        tset.append("4", "4");
        p_layout.field("tree") << p_tree;
        p_menu.append("clear", [this](const nana::menu::item_proxy &in_)
                      { p_tree.clear(); });
        p_tree.events().mouse_down(nana::menu_popuper(p_menu));

        p_layout.collocate();
    };
};

nana::treebox::clear Unable to clear all items
image

Thanks for reporting this bug.