HBox

Lays out its children in a row, with the first child on the left, and the last child on the right.

Glok includes an application TestHBox that you can play with, if you download the source code.

fillHeight : true

┌──────────────────────────┐
│ ┌───┐ ┌────────┐ ┌──┐    │
│ │   │ │        │ │  │    │
│ │   │ │        │ │  │    │
│ │   │ │        │ │  │    │
│ │   │ │        │ │  │    │
│ │   │ │        │ │  │    │
│ └───┘ └────────┘ └──┘    │
└──────────────────────────┘

fillHeight : false

VAlignment.BOTTOM :

┌──────────────────────────┐
│ ┌───┐                    │
│ │   │                    │
│ │   │            ┌──┐    │
│ │   │            │  │    │
│ │   │ ┌────────┐ │  │    │
│ │   │ │        │ │  │    │
│ └───┘ └────────┘ └──┘    │
└──────────────────────────┘

VAlignment.TOP (the default) :

┌──────────────────────────┐
│ ┌───┐ ┌────────┐ ┌──┐    │
│ │   │ │        │ │  │    │
│ │   │ └────────┘ │  │    │
│ │   │            │  │    │
│ │   │            └──┘    │
│ │   │                    │
│ └───┘                    │
└──────────────────────────┘

VAlignment.CENTER :

┌──────────────────────────┐
│ ┌───┐                    │
│ │   │            ┌──┐    │
│ │   │ ┌────────┐ │  │    │
│ │   │ │        │ │  │    │
│ │   │ └────────┘ │  │    │
│ │   │            └──┘    │
│ └───┘                    │
└──────────────────────────┘

Then for each of these, we also align horizontally according to alignment's Alignment.hAlignment.

When fillHeight == true, the children's height is set to this HBox's height minus its padding. In all cases, the children's heights are set to their evalPrefHeight.

Note, in these diagrams, there is additional space to the right of the last child. This is either because the children set their growPriority to 0, or they reached their evalMaxWidth. Otherwise, the children would have filled the HBox horizontally.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
open override val children: MutableObservableList<Node>

The base class Node has no children, so this is an empty list.

Link copied to clipboard

Functions

Link copied to clipboard
open override fun toString(): String