An exclusive-choice segmented control (radio group): label left, equal-width segments in a
box on the right. Exactly one segment is selected; picking another slides the accent pill
over and fires onChange(index). Taller by default on mobile for touch.
Constructor
new(label:String, width:Float, items:Array<String>, ?onChange:Int ‑> Void)
Parameters:
label | the row text on the left (empty = the box spans the whole row) |
|---|---|
width | layout width (the segment box sits at the right edge) |
items | the segment labels |
onChange | fired with the new index when the user picks a segment |
Variables
Methods
localize(key:String, fallback:String):Void
Switches the row label to a localized string.
Parameters:
key | the translation key |
|---|---|
fallback | the source-language text |
select(index:Int):Void
Programmatically selects a segment without firing onChange (the pill snaps).
Parameters:
index | the segment to select (ignored when out of range) |
|---|