Function fltk::draw::draw_box

source ยท
pub fn draw_box(
    box_type: FrameType,
    x: i32,
    y: i32,
    w: i32,
    h: i32,
    color: Color,
)
Expand description

Draws a box given the box type, size, position and color

Examples found in repository?
examples/table.rs (lines 48-55)
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
fn draw_header(txt: &str, x: i32, y: i32, w: i32, h: i32) {
    draw::push_clip(x, y, w, h);
    draw::draw_box(
        enums::FrameType::ThinUpBox,
        x,
        y,
        w,
        h,
        enums::Color::FrameDefault,
    );
    draw::set_draw_color(enums::Color::Black);
    draw::set_font(enums::Font::Helvetica, 14);
    draw::draw_text2(txt, x, y, w, h, enums::Align::Center);
    draw::pop_clip();
}
More examples
Hide additional examples
examples/spreadsheet.rs (lines 114-121)
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
    fn draw_header(txt: &str, x: i32, y: i32, w: i32, h: i32) {
        draw::push_clip(x, y, w, h);
        draw::draw_box(
            enums::FrameType::ThinUpBox,
            x,
            y,
            w,
            h,
            enums::Color::FrameDefault,
        );
        draw::set_draw_color(enums::Color::Black);
        draw::set_font(enums::Font::Helvetica, 14);
        draw::draw_text2(txt, x, y, w, h, enums::Align::Center);
        draw::pop_clip();
    }