Box(3I)

πŸ’– Box(3I) β€” bestie edition πŸ’–

ok so this is Box, plus its two iconic siblings HBox and VBox, straight out of the InterViews Reference Manual. tiling interactors in a box, no cap. let's get into it 🫢


✨ NAME ✨

Box, HBox, VBox β€” tile interactors in a box πŸŽ€


✨ SYNOPSIS ✨

#include <InterViews/box.h>

like that's it, that's the whole vibe πŸ’…


✨ DESCRIPTION ✨

okay so a box is a scene of interactors that get tiled side-by-side in whatever space is available. in a horizontal box the interactors go left-to-right, and in a vertical box they go top-to-bottom. periodt. ✨

a box will literally try to stretch or shrink the interactors inside it so they fit the available space. the natural size of a box is the sum of its elements along the major axis, and the maximum along its minor axis. and a box's stretchability (which is the same thing as its shrinkability, not me making up two names πŸ™ˆ) is the sum of its elements along its major axis and the minimum of its elements along its minor axis. iykyk. 🌈


✨ PUBLIC OPERATIONS ✨

  • HBox(...)
  • VBox(...)

create a new box, slay πŸ’… zero to seven interactors may be passed as arguments, and those interactors get inserted into the box. that's it, that's the constructor.

  • void Align(Alignment)

sets the alignment mode that the box uses to place elements along the minor axis. the default alignment for an hbox is Bottom; the other choices are Top and Center. the default alignment for a vbox is Left; the other choices are Right and Center. pick your fighter πŸŽ€

  • void Insert(Interactor*)

appends an interactor to the box. components of an hbox (vbox) will appear left-to-right (top-to-bottom) in the order in which they are inserted. so the order you insert them is literally the order you see them, iconic behavior fr fr πŸ‘‘

  • void Change(Interactor*)

notifies the box that the given interactor's shape has changed. if change propagation is true, the box will modify its own shape to reflect the change and notify its parent. regardless of propagation, the box will recompute the positions of the component interactors and update any that have changed. so either way it's handling business, it's just a question of whether it tells its parent too πŸ¦‹

  • void Remove(Interactor*)

takes an element out of a box. heads up bestie: Remove does not cause any immediate change to the other components in the box β€” the Change operation must be called after one or more Removes to update the component positions. so don't be out here expecting it to clean up after itself, you gotta call Change yourself πŸ’€


✨ SEE ALSO ✨

Glue(3I), Interactor(3I), Scene(3I), Shape(3I) 🌸


and that's the whole page, bestie 🫢 this one came out of the InterViews reference manual, dated 15 June 1987 (a vintage queen, honestly πŸ‘‘), and it's filed under Box(3I). go tile something gorgeous. πŸ’œ