Skip to main content

grid_layout_column_major

Macro grid_layout_column_major 

Source
macro_rules! grid_layout_column_major {
    ($name:ident, ($x:expr, $y:expr, $width:expr, $height:expr),
        ($rows:expr, $cols:expr, $gap:expr), [$first:ident, $($rest:ident),+ $(,)?]) => { ... };
}
Expand description

Creates a column-major grid layout with region IDs starting from 0.

This macro generates:

  • A region ID enum with variants for each region
  • Constants for each region in the grid
  • A constant for the grid layout array

ยงUsage

use matrix_gui::grid_layout_column_major;
use matrix_gui::prelude::*;

grid_layout_column_major!(
    Button, (10, 10, 200, 100),
    (2, 2, 10), [Ok, Cancel, Reset, Exit]
);