How can I set “id” in newSegmentedControl?
I’ve tried the following, but target.id
is always nil.
local function onSegmentPress( event ) local target = event.target print( "Segment Label is:", target.segmentLabel ) print( "Segment Number is:", target.segmentNumber ) print( "id:", target.id ) end local segmentedControl = widget.newSegmentedControl { id = "myID", left = 0, top = b.y - 13, segmentWidth = 60, segments = s, defaultSegment = 1, onPress = onSegmentPress }