# Grid Layout Options Properties

Description of the grid layout options set of properties.

## Calling Sequence

                layout_options = createLayoutOptions("grid")
                layout_options = createLayoutOptions("grid", size)
                layout_options = createLayoutOptions("grid", size, padding)

## Arguments

size

  `[width, heigth]` a 1-by-2 matrix of double, [0,0] by default

  The `width` and `heigth` of the grid in number of elements (not pixels).

  A value of 0 for either `width` or `heigth` defines an indefinite number of elements on the rows or columns of the grid.

padding

  `[pad_x, pad_y]` a 1-by-2 matrix of doubles, [0,0] by default.

  The padding between elements of the grid in pixels.

layout_options

  The created layout_options.

## Description

This functions creates the grid layout options to set uicontrols `layout_options` attribute.

## Examples

             //Create a figure with a grid layout
             f = figure( ...
             "dockable"        , "off",...
             "infobar_visible" , "off",...
             "toolbar"         , "none",...
             "menubar_visible" , "off",...
             "menubar"         , "none",...
             "default_axes"    , "off",...
             "layout"          , "grid",...
             "visible"         , "on");

             //Set the grid to be 2 by 3 elements
             lay_opt = createLayoutOptions("grid", [2,3]);
             set(f,"layout_options",lay_opt);

             //Insert uicontrols on the grid
             //Each uicontrol is inserted from left to right
             //and top to bottom

             c = createConstraints("grid"); //Create the constraint for nested uicontrols

             u_grid1 = uicontrol(f,...
             "style", "frame",...
             "backgroundcolor", [1 0 0],...
             "constraints", c);

             sleep(500);
             u_grid2 = uicontrol(f,...
             "style", "frame",...
             "backgroundcolor", [0 1 0],...
             "constraints", c);

             sleep(500);
             u_grid3 = uicontrol(f,...
             "style", "frame",...
             "backgroundcolor", [0 0 1],...
             "constraints", c);

             sleep(500);
             u_grid4 = uicontrol(f,...
             "style", "frame",...
             "backgroundcolor", [1 1 0],...
             "constraints", c);

             sleep(500);
             u_grid5 = uicontrol(f,...
             "style", "frame",...
             "backgroundcolor", [1 0 1],...
             "constraints", c);

             sleep(500);
             u_grid6 = uicontrol(f,...
             "style", "frame",...
             "backgroundcolor", [0 1 1],...
             "constraints", c);

## See Also

- layout
- createLayoutOptions
- uicontrol
- uicontrol_properties

## History

5.5.0
Function `createBorder` introduced.