Add a missing range check to List
signal_item_selected.emit(index, item);
}
+
+Dropdown::Loader::Loader(Dropdown &d):
+ Widget::Loader(d)
+{
+ add("item", &Loader::item);
+}
+
+void Dropdown::Loader::item(const string &str)
+{
+ static_cast<Dropdown &>(wdg).append(str);
+}
+
} // namespace GLtk
} // namespace Msp
class Dropdown: public Widget
{
+public:
+ class Loader: public Widget::Loader
+ {
+ public:
+ Loader(Dropdown &);
+ private:
+ void item(const std::string &);
+ };
+
private:
List *list;
std::string text;
y+=items_part->get_margin().top;
unsigned i=(geom.h-1-y)/row_height;
- if(i<n_visible)
+ if(i<n_visible && first+i<items.size())
{
sel_index=first+i;