Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.1.1 - Русский

Change language to:
English - Français - 日本語 - Português -

Please note that the recommended version of Scilab is 2024.1.0. This page might be outdated.
See the recommended documentation of this function

Справка Scilab >> GUI > Layouts > Grid Layout Options Properties

Grid Layout Options Properties

Description of the grid layout options set of properties.


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



1×2 vector [nRows, nCols]: The numbers of rows and columns of cells (not of pixels) of the grid. [0,0] by default.

A value of -1 for either nRows or nCols defines an indefinite number of elements in the columns or rows.


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

The padding between elements of the grid in pixels.


The created layout_options.


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


//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]);

//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);

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

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

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

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

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

See also

  • layout — Description of the different layouts and constraints for uicontrols and figures.
  • createLayoutOptions — Creates the layout options for a frame uicontrol or a figure
  • uicontrol — create a Graphic User Interface object
  • uicontrol_properties — Description of the uicontrol properties.


5.5.0 Function createLayoutOptions() introduced.
Report an issue
<< Grid Constraints Properties Layouts Gridbag Constraints Properties >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Mon Jan 03 14:39:58 CET 2022