add joke example program

This commit is contained in:
hippoz 2022-07-05 20:53:26 +03:00
parent b0315b76be
commit a1f544ae82
Signed by: hippoz
GPG key ID: 7C52899193467641

View file

@ -23,18 +23,11 @@ int main() {
auto main_widget = window.set_main_widget<Raven::Widget>(); auto main_widget = window.set_main_widget<Raven::Widget>();
main_widget->set_layout<Raven::VerticalBoxLayout>(6.0); main_widget->set_layout<Raven::VerticalBoxLayout>(6.0);
auto scroll_container = main_widget->add<Raven::ScrollContainer>(); auto compile_button = main_widget->add<Raven::Button>("compile and run program");
scroll_container->set_scroll(Raven::Point(0, 0)); compile_button->set_style(&Raven::accent_button_style);
scroll_container->resize_fixed(100, 100); compile_button->on_click = []() {
scroll_container->set_style(&Raven::accent_widget_style); system("./compile.sh");
};
auto target = scroll_container->make_target();
target->set_layout<Raven::DocumentLayout>(6.0);
auto hello_button = target->add<Raven::Button>("hello");
hello_button->set_style(&Raven::accent_button_style);
auto bye_button = target->add<Raven::Button>("bye");
bye_button->set_style(&Raven::accent_button_style);
window.run(true); window.run(true);
return 0; return 0;