aboutsummaryrefslogtreecommitdiff
path: root/include/gui/RadioButton.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/gui/RadioButton.hpp')
-rw-r--r--include/gui/RadioButton.hpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/gui/RadioButton.hpp b/include/gui/RadioButton.hpp
index a009eab..e319aa0 100644
--- a/include/gui/RadioButton.hpp
+++ b/include/gui/RadioButton.hpp
@@ -23,11 +23,13 @@ namespace gsr {
void add_item(const std::string &text, const std::string &id);
void set_selected_item(const std::string &id, bool trigger_event = true, bool trigger_event_even_if_selection_not_changed = true);
- const std::string get_selected_id() const;
+ const std::string& get_selected_id() const;
+ const std::string& get_selected_text() const;
mgl::vec2f get_size() override;
- std::function<void(const std::string &text, const std::string &id)> on_selection_changed;
+ // Return false to revert the change
+ std::function<bool(const std::string &text, const std::string &id)> on_selection_changed;
private:
void update_if_dirty();
private: