GMGridContainer is a layout utility class that will arrange its children according to a grid, trying to allocate an even space to every widget.
Contrary to most Graphical Module classes, it does not inherit from GMUserView.
To use this class, one must instanciate it, then use the insertView
to insert views inside it :
insertView
takes the view as mandatory argument, then an optionnal index argument. If none is provided, the view will be inserted last in the grid. When the view is inserted, the GMGridContainer will be set as its parent.
One can use the removeView
method to remove a view from the grid. However, this only removes the view from the GMGridContainer internal view list : the view will be removed from the display calculation, but will continue to exist as a child of the GMGridContainer. Depending on your needs, you also need to either remove the widget using its destroy
method, or assign a new parent to it using setParent
.
Since GMGridContainer uses the onResize
action internally, the associated function has been replaced with a FunctionList
. One should use addFunc
to assign new actions to be performed when a GMGridContainer is resized.
Insert a new view inside this class layout. Every child view will be rearranged automatically into an even spaced grid.
Remove a view from the internal view list. The view needs either needs to be destroyed, or reassigned a new parent in order to disappear from the GMGridContainer.
Sets or gets the orientation of the grid. Can be either \horizontal or \vertical.abs
Sets or gets the margin value between each views, in pixels.