defaults/
defaults.rs

1use fltk::{enums::*, prelude::*, *};
2
3fn main() {
4    let app = app::App::default();
5    // global theming
6    app::background(55, 55, 55); // background color.
7                                 // For input/output and text widgets, use app::background2
8    app::background2(0, 0, 0);
9    app::foreground(255, 255, 255); // labels
10    app::set_font_size(16);
11    app::set_frame_type2(FrameType::UpBox, FrameType::RFlatBox);
12    app::set_frame_type2(FrameType::DownBox, FrameType::RFlatBox);
13    app::set_frame_border_radius_max(15); // set the roundness of the RFlatBox
14    app::set_font(Font::Times);
15    app::set_visible_focus(false);
16
17    // regular widget code
18    let mut win = window::Window::default().with_size(400, 300);
19    let mut flex = group::Flex::default_fill().column();
20    flex.set_margins(100, 60, 100, 60);
21    flex.set_pad(10);
22    let mut btn1 = button::Button::default().with_label("Increment");
23    btn1.set_color(Color::Red.darker());
24    btn1.set_selection_color(Color::Red.darker().darker());
25    let mut out = frame::Frame::default().with_label("0");
26    out.set_color(Color::Green.darker());
27    let mut btn2 = button::Button::default().with_label("Decrement");
28    btn2.set_color(Color::Red.darker());
29    btn2.set_selection_color(Color::Red.darker().darker());
30    flex.end();
31    win.end();
32    win.show();
33
34    app.run().unwrap();
35}