fltk-grid

A grid widget for fltk-rs.

Usage

toml [dependencies] fltk = "1.3" fltk-grid = "0.1"

Basically, the crate contains a single type Grid which has 4 main non-constructor methods: - setlayout(): specifies the number of rows and columns of the grid. - insert(): specifies the widget to be inserted, along with in which cell (row, column). - insertext(): adds to insert the row span and column span. - resize(): determines how the grid is resized. - debug(): shows the cell outline and their numbering, useful for prototyping.

```rust use fltk::{prelude::*, *}; use fltk_grid::Grid;

fn main() { let a = app::App::default().withscheme(app::Scheme::Gtk); let mut win = window::Window::default().withsize(500, 300); let mut grid = Grid::defaultfill(); grid.debug(false); // set to true to show cell outlines and numbers grid.setlayout(5, 5); // 5 rows, 5 columns grid.insert(&mut button::Button::default(), 0, 1); // widget, row, col grid.insertext(&mut button::Button::default(), 2, 1, 3, 1); // widget, row, col, rowspan, col_span win.end(); win.show(); a.run().unwrap(); } ```

Example

Run cargo run --example form

image

Setting Grid::debug(true):

image