diff --git a/include/nana/gui/widgets/listbox.hpp b/include/nana/gui/widgets/listbox.hpp index 1bc087be..10e5dab0 100644 --- a/include/nana/gui/widgets/listbox.hpp +++ b/include/nana/gui/widgets/listbox.hpp @@ -474,6 +474,8 @@ By \a clicking on a header the list get \a reordered, first up, and then down al void auto_draw(bool); ///); ///(cont_.size())); } - void item_width(size_type index, unsigned width) + void item_width(size_type pos, unsigned width) { - if (index >= cont_.size()) + if (pos >= cont_.size()) return; for(auto & m : cont_) { - if(m.index == index) + if(m.index == pos) m.pixels = width; } } + unsigned item_width(size_type pos) const + { + for (auto & m : cont_) + { + if (m.index == pos) + return m.pixels; + } + return 0; + } + unsigned pixels() const { unsigned pixels = 0; @@ -3602,6 +3612,19 @@ namespace nana ess.update(); } + listbox& listbox::header_width(size_type pos, unsigned pixels) + { + auto & ess = _m_ess(); + ess.header.item_width(pos, pixels); + ess.update(); + return *this; + } + + unsigned listbox::header_width(size_type pos) const + { + return _m_ess().header.item_width(pos); + } + listbox::cat_proxy listbox::append(nana::string s) { internal_scope_guard lock;