#include "Label.hpp" #include "Window.hpp" #include "Widget.hpp" #include "Button.hpp" #include "Box.hpp" #include "Label.hpp" #include "Layout.hpp" #include "RGB.hpp" #include "DocumentLayout.hpp" #include "Events.hpp" #include "src/Styles.hpp" #include #include #include #include void update_count_label_text(std::shared_ptr label, int number) { std::stringstream text; text << "you have clicked the button " << std::to_string(number) << " times"; label->set_text(text.str()); } int main() { Raven::Window window {}; int number = 0; window.spawn_window(); auto main_widget = window.set_main_widget(); main_widget->set_layout(10.0); auto count_label = main_widget->add("you have clicked the button 0 times"); main_widget->add(Raven::ControlWidgetType::NewRow); auto increment_button = main_widget->add("click me"); increment_button->set_style(&Raven::accent_button_style); increment_button->on_click = [&]() { number++; update_count_label_text(count_label, number); }; auto reset_button = main_widget->add("reset"); reset_button->on_click = [&]() { number = 0; update_count_label_text(count_label, number); }; window.run(true); return 0; }