Button¶
A simple button with a text label.
Declaration¶
namespace bdn::ui {
class Button : public View
}
Example¶
#include <bdn/ui/Button.h>
// ...
auto button = std::make_shared<Button>();
button->label = "Click me!";
button->onClick() += [](auto event) {
// Do something on submit
};
Properties¶
-
Property<std::string> label
The button's label.
Events¶
-
Notifier<const ClickEvent &> &onClick()
A notifier for click events. Subscribe to this notifier if you want to be notified when the user clicks the button.
Relationships¶
Inherits from View
.