1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
use fltk::{
    app,
    button::*,
    group::{Group, Pack, Tabs},
    input::Input,
    menu::{Choice, MenuButton},
    output::Output,
    prelude::{GroupExt, MenuExt, WidgetBase, WidgetExt, WindowExt},
    window::Window,
};

fn draw_gallery() {
    let tab = Tabs::new(10, 10, 500 - 20, 450 - 20, "");

    let grp1 = Group::new(10, 35, 500 - 20, 450 - 45, "Tab1\t\t");

    let mut pack = Pack::new(15, 45, 150, 450 - 45, "");
    pack.set_spacing(10);
    let _but1 = Button::default().with_size(0, 30).with_label("Button");
    let _but2 = RoundButton::default().with_size(0, 30).with_label("Round");
    let _but3 = CheckButton::default().with_size(0, 30).with_label("Check");
    let _but4 = LightButton::default().with_size(0, 30).with_label("Light");
    let mut but5 = MenuButton::default().with_size(0, 30).with_label("Menu");
    but5.add_choice("Hello|World|From|Rust");
    let _but6 = ReturnButton::default()
        .with_size(0, 30)
        .with_label("Return");
    let mut chce = Choice::new(50, 240, 90, 30, "");
    chce.add_choice("Hello");
    let _inp = Input::default().with_size(0, 30).with_label("");
    let _out = Output::default().with_size(0, 30).with_label("");

    pack.end();
    grp1.end();

    let grp2 = Group::new(10, 35, 500 - 30, 450 - 25, "Tab2\t\t");
    grp2.end();
    tab.end();
}

fn main() {
    let app = app::App::default().with_scheme(app::Scheme::Gtk);
    app::background(221, 221, 221);

    let mut wind = Window::default()
        .with_size(500, 450)
        .with_label("Tabs")
        .center_screen();

    draw_gallery();

    wind.make_resizable(true);
    wind.end();
    wind.show();

    app.run().unwrap();
}