2022-03-26 02:57:41 +02:00
|
|
|
#include "Label.hpp"
|
2022-03-08 02:25:22 +02:00
|
|
|
#include "Window.hpp"
|
2022-03-09 20:02:18 +02:00
|
|
|
#include "Widget.hpp"
|
2022-03-09 20:16:05 +02:00
|
|
|
#include "Button.hpp"
|
2022-03-09 20:02:18 +02:00
|
|
|
#include "Box.hpp"
|
2022-03-26 02:57:41 +02:00
|
|
|
#include "Label.hpp"
|
2022-01-22 17:51:54 +02:00
|
|
|
|
|
|
|
int main() {
|
2022-03-09 03:46:27 +02:00
|
|
|
Raven::Window window {};
|
2022-03-18 02:49:16 +02:00
|
|
|
Raven::Widget main_widget {};
|
2022-03-09 20:16:05 +02:00
|
|
|
Raven::Button button {"click me!"};
|
2022-03-26 02:57:41 +02:00
|
|
|
Raven::Label label {"you have not yet clicked the button..."};
|
2022-01-22 17:51:54 +02:00
|
|
|
|
2022-03-09 20:02:18 +02:00
|
|
|
window.spawn_window();
|
|
|
|
|
2022-03-09 20:16:05 +02:00
|
|
|
button.set_current_geometry(Raven::Box(10, 10, 100, 30));
|
2022-03-26 02:57:41 +02:00
|
|
|
label.set_current_geometry(Raven::Box(10, 45, 100, 20));
|
|
|
|
|
2022-03-18 03:04:34 +02:00
|
|
|
main_widget.set_background_fill_color(window.get_top_level_styles()->get_background_color());
|
|
|
|
main_widget.set_do_background_fill(true);
|
2022-03-18 02:49:16 +02:00
|
|
|
window.set_main_widget(&main_widget);
|
|
|
|
|
2022-03-26 02:57:41 +02:00
|
|
|
button.on_click = [&label]() {
|
|
|
|
label.set_text("you clicked it!!!!!");
|
2022-03-20 03:05:21 +02:00
|
|
|
};
|
|
|
|
|
2022-03-18 02:49:16 +02:00
|
|
|
main_widget.add_child(&button);
|
2022-03-26 02:57:41 +02:00
|
|
|
main_widget.add_child(&label);
|
2022-01-22 17:51:54 +02:00
|
|
|
|
2022-03-09 20:02:18 +02:00
|
|
|
window.run(true);
|
2022-01-22 17:51:54 +02:00
|
|
|
return 0;
|
2022-03-08 02:25:22 +02:00
|
|
|
}
|