 Vertical Glue - Maple Help

Maplets[Elements]

 VerticalGlue
 specify spacing in a column of a box layout Calling Sequence VerticalGlue() Description

 • 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. Examples

Alignment with valign.

 > $\mathrm{with}\left(\mathrm{Maplets}\left[\mathrm{Elements}\right]\right):$
 > \mathrm{maplet}≔\mathrm{Maplet}\left(\mathrm{BoxLayout}\left(\mathrm{BoxColumn}\left(\mathrm{TextBox}\left(\mathrm{height}=10,\mathrm{width}=8,"This is a tall narrow text box to force additional space so"‖"the alignment of the buttons on the right is relevant"\right)\right),\mathrm{BoxColumn}\left(\mathrm{BoxCell}\left(\mathrm{Button}\left("Quit1",\mathrm{Shutdown}\left(\right)\right),\mathrm{valign}=\mathrm{top}\right),\mathrm{BoxCell}\left(\mathrm{Button}\left("Quit2",\mathrm{Shutdown}\left(\right)\right),\mathrm{valign}=\mathrm{bottom}\right)\right)\right)\right):
 > $\mathrm{Maplets}\left[\mathrm{Display}\right]\left(\mathrm{maplet}\right)$

Same alignment using VerticalGlue.

 > \mathrm{maplet}≔\mathrm{Maplet}\left(\mathrm{BoxLayout}\left(\mathrm{BoxColumn}\left(\mathrm{TextBox}\left(\mathrm{height}=10,\mathrm{width}=8,"This is a tall narrow text box to force additional space so"‖"the alignment of the buttons on the right is relevant"\right)\right),\mathrm{BoxColumn}\left(\mathrm{valign}=\mathrm{none},\mathrm{Button}\left("Quit1",\mathrm{Shutdown}\left(\right)\right),\mathrm{VerticalGlue}\left(\right),\mathrm{Button}\left("Quit2",\mathrm{Shutdown}\left(\right)\right)\right)\right)\right):
 > $\mathrm{Maplets}\left[\mathrm{Display}\right]\left(\mathrm{maplet}\right)$

Example with three buttons that is only possible with halign=none and VerticalGlue.

 > \mathrm{maplet}≔\mathrm{Maplet}\left(\mathrm{BoxLayout}\left(\mathrm{BoxColumn}\left(\mathrm{TextBox}\left(\mathrm{height}=10,\mathrm{width}=8,"This is a tall narrow text box to force additional space so"‖"the alignment of the buttons on the right is relevant"\right)\right),\mathrm{BoxColumn}\left(\mathrm{valign}=\mathrm{none},\mathrm{Button}\left("Quit1",\mathrm{Shutdown}\left(\right)\right),\mathrm{Button}\left("Quit2",\mathrm{Shutdown}\left(\right)\right),\mathrm{VerticalGlue}\left(\right),\mathrm{Button}\left("Quit3",\mathrm{Shutdown}\left(\right)\right)\right)\right)\right):
 > $\mathrm{Maplets}\left[\mathrm{Display}\right]\left(\mathrm{maplet}\right)$

Example where enlarging the window will cause the buttons to remain on the top.

 > \mathrm{maplet}≔\mathrm{Maplet}\left(\mathrm{BoxLayout}\left(\mathrm{BoxColumn}\left(\mathrm{valign}=\mathrm{none},\mathrm{Button}\left("Quit1",\mathrm{Shutdown}\left(\right)\right),\mathrm{Button}\left("Quit2",\mathrm{Shutdown}\left(\right)\right),\mathrm{VerticalGlue}\left(\right)\right)\right)\right):
 > $\mathrm{Maplets}\left[\mathrm{Display}\right]\left(\mathrm{maplet}\right)$

Example where enlarging the window will cause the buttons to remain on opposite ends of the window.

 > \mathrm{maplet}≔\mathrm{Maplet}\left(\mathrm{BoxLayout}\left(\mathrm{BoxColumn}\left(\mathrm{valign}=\mathrm{none},\mathrm{Button}\left("Quit1",\mathrm{Shutdown}\left(\right)\right),\mathrm{VerticalGlue}\left(\right),\mathrm{Button}\left("Quit1",\mathrm{Shutdown}\left(\right)\right)\right)\right)\right):
 > $\mathrm{Maplets}\left[\mathrm{Display}\right]\left(\mathrm{maplet}\right)$