fltk-flex

Crates.iofltk-flex
lib.rsfltk-flex
version0.2.1
sourcesrc
created_at2021-07-19 00:54:40.011883
updated_at2021-09-24 00:37:27.387559
descriptionA flexbox widget for fltk-rs
homepage
repositoryhttps://github.com/fltk-rs/fltk-flex
max_upload_size
id424547
size13,152
Mohammed Alyousef (MoAlyousef)

documentation

https://docs.rs/fltk-flex

README

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();
}
Commit count: 10

cargo fmt