Empirical
|
Specs for the Selector widget. More...
Go to the source code of this file.
Classes | |
class | emp::web::Selector |
class | emp::web::Selector::SelectorInfo |
Namespaces | |
emp | |
If we are in emscripten, make sure to include the header. | |
emp::web | |
Specs for the Selector widget.
A Selector widget provides the user with a pull-down menu. It can be examined at any time (via GetSelectID()) or else alerts call a designated function when a particular option is chosen.
UI::Selector sel("sel");
sel.SetOption("Option 1"); sel.SetOption("Option B", TriggerB) ; sel.SetOption("Option the Third", [](){ emp::Alert("3 chosen!"} ); sel.SetOption("Option IV");
In this example, the second option will call TriggerB when it is chosen, while the third option will call the provided lambda function.