Skip to content

form.getFieldSlots

since 1.1.0

Return a table of coordinates for fields in a line.

local rects = form.getFieldSlots(line, fields)

Parameters

Name Type Required Description
line FormLine yes the line where the field should be added
fields nil or table yes table of specs for each field in the line (either a string, or a width). The available space will be splitted into all cells where specs have a zero-width

Returns

rects (table of Rect): the coordinates

Examples

From the official Ethos documentation
form.getFieldSlots(line, nil)
form.getFieldSlots(line, {100, 0, "slot3"})

Used in

Real-world usage

Called 79 times across 5 open-source Ethos Lua projects. A few short excerpts:
local slots = form.getFieldSlots(line, fieldLabels)

lua/frsky/RB25_S/stab/stab.lua:362

local slots = form.getFieldSlots(line, {0, SLOT_HINT, SLOT_HINT, SLOT_HINT, SLOT_HINT})

src/rfsuite/app/header.lua:255

local line = form.addLine("")
local slot = form.getFieldSlots(line, {0})[1]

src/wfsuite/app/pages/alignment.lua:60