Empirical
Classes | Namespaces
Selector.h File Reference

Specs for the Selector widget. More...

#include "../base/vector.h"
#include "JSWrap.h"
#include "Widget.h"

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
 

Detailed Description

Specs for the Selector widget.

Note
This file is part of Empirical, https://github.com/devosoft/Empirical
Date
2015-2017

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.