7 releases

0.2.1 Sep 24, 2021
0.2.0 Sep 23, 2021
0.1.4 Sep 22, 2021
0.1.2 Aug 10, 2021
0.1.1 Jul 19, 2021

#205 in #widgets

Download history 13/week @ 2024-07-21 10/week @ 2024-07-28 3/week @ 2024-08-04 6/week @ 2024-08-11 1/week @ 2024-08-18 12/week @ 2024-09-08 5/week @ 2024-09-15 44/week @ 2024-09-22 37/week @ 2024-09-29 1/week @ 2024-10-06 26/week @ 2024-10-13 10/week @ 2024-10-20 17/week @ 2024-10-27 18/week @ 2024-11-03

71 downloads per month

MIT license

5KB

fltk-flex

Note to current and future users:

The Flex widget has been added to the fltk crate, under the group module. This repo mostly now serves the purpose of providing examples of usage!

A Rust port of FL_Flex, which provides a flexbox widget for FLTK.

Usage

[dependencies]
fltk = "1.2"
fltk-flex = "0.2"

Example

use fltk::{prelude::*, *};
use fltk_flex::Flex;

fn main() {
    let a = app::App::default().with_scheme(app::Scheme::Gtk);
    let mut win = window::Window::default().with_size(400, 300);
    let mut flex = Flex::default().size_of_parent().column();
    let _expanding = button::Button::default().with_label("Expanding");
    let mut normal = button::Button::default().with_label("Normal");
    flex.set_size(&mut normal, 30);
    flex.end();
    win.end();
    win.make_resizable(true);
    win.show();
    a.run().unwrap();
}

lib.rs:

fltk-flex

A Rust port of FL_Flex, which provides a flexbox widget for fltk-rs.

Usage

[dependencies]
fltk = "1.2"
fltk-flex = "0.2"

Example

use fltk::{prelude::*, *};
use fltk_flex::Flex;

fn main() {
let a = app::App::default().with_scheme(app::Scheme::Gtk);
let mut win = window::Window::default().with_size(400, 300);
let mut flex = Flex::default().size_of_parent().column();
let _expanding = button::Button::default().with_label("Expanding");
let mut normal = button::Button::default().with_label("Normal");
flex.set_size(&mut normal, 30);
flex.end();
win.end();
win.make_resizable(true);
win.show();
a.run().unwrap();
}

Dependencies

~14MB
~310K SLoC