Maplets[Elements]
VerticalGlue
specify spacing in a column of a box layout
Calling Sequence
Description
Examples
VerticalGlue()
The VerticalGlue layout element adds flexible spacing in its location in a BoxColumn of a box layout.
When a column is initially sized, any extra space not consumed by the visible elements is equally distributed to all VerticalGlue elements in that column. This includes any VerticalGlue elements that are implicitly defined through the valign argument for the BoxColumn or the elements of the BoxColumn.
When the row is resized (for example, by resizing the window) the change height of the BoxColumn is applied to the VerticalGlue elements equally when possible.
The VerticalGlue layout element takes no additional options.
A VerticalGlue element can only be contained in a BoxColumn element, and is most useful when the BoxColumn has been specified with valign=none, allowing greater control of spacing of the elements within the column.
Alignment with valign.
with⁡MapletsElements:
maplet≔Maplet⁡BoxLayout⁡BoxColumn⁡TextBox⁡height=10,width=8,This is a tall narrow text box to force additional space so ‖the alignment of the buttons on the right is relevant,BoxColumn⁡BoxCell⁡Button⁡Quit1,Shutdown⁡,valign=top,BoxCell⁡Button⁡Quit2,Shutdown⁡,valign=bottom:
MapletsDisplay⁡maplet
Same alignment using VerticalGlue.
maplet≔Maplet⁡BoxLayout⁡BoxColumn⁡TextBox⁡height=10,width=8,This is a tall narrow text box to force additional space so ‖the alignment of the buttons on the right is relevant,BoxColumn⁡valign=none,Button⁡Quit1,Shutdown⁡,VerticalGlue⁡,Button⁡Quit2,Shutdown⁡:
Example with three buttons that is only possible with halign=none and VerticalGlue.
maplet≔Maplet⁡BoxLayout⁡BoxColumn⁡TextBox⁡height=10,width=8,This is a tall narrow text box to force additional space so ‖the alignment of the buttons on the right is relevant,BoxColumn⁡valign=none,Button⁡Quit1,Shutdown⁡,Button⁡Quit2,Shutdown⁡,VerticalGlue⁡,Button⁡Quit3,Shutdown⁡:
Example where enlarging the window will cause the buttons to remain on the top.
maplet≔Maplet⁡BoxLayout⁡BoxColumn⁡valign=none,Button⁡Quit1,Shutdown⁡,Button⁡Quit2,Shutdown⁡,VerticalGlue⁡:
Example where enlarging the window will cause the buttons to remain on opposite ends of the window.
maplet≔Maplet⁡BoxLayout⁡BoxColumn⁡valign=none,Button⁡Quit1,Shutdown⁡,VerticalGlue⁡,Button⁡Quit1,Shutdown⁡:
See Also
Maplets/LayoutElements
Maplets[Display]
Maplets[Elements][BoxCell]
Maplets[Elements][BoxColumn]
Maplets[Elements][BoxLayout]
Maplets[Elements][BoxRow]
Maplets[Elements][HorizontalGlue]
Maplets[Elements][Maplet]
Overview of Maplet Applications
Download Help Document