hello_flex/
hello_flex.rs

1use fltk::{app, button::Button, frame::Frame, group::Flex, prelude::*, window::Window};
2
3fn main() {
4    let app = app::App::default();
5    let mut wind = Window::default().with_size(400, 300);
6    let mut col = Flex::default_fill().column();
7    col.set_margins(120, 80, 120, 80);
8    let mut frame = Frame::default();
9    let mut but = Button::default().with_label("Click me!");
10    col.fixed(&but, 40);
11    col.end();
12    wind.end();
13    wind.show();
14
15    but.set_callback(move |_| frame.set_label("Hello world"));
16
17    app.run().unwrap();
18}