Sub SetButtonTextSize(ex As Button, txt As String)
Log(">> This is going to change:" & ex)
Dim dt As Float
Dim limit = 0.5 As Float
Dim h As Int
Dim stu As StringUtils
ex.Text = txt
ex.TextSize = 72
dt = ex.TextSize
h = stu.MeasureMultilineTextHeight(ex, txt)
Do While dt > limit OR h > ex.Height
dt = dt / 2
h = stu.MeasureMultilineTextHeight(ex, txt)
If h > ex.Height Then
ex.TextSize = ex.TextSize - dt
Else
ex.TextSize = ex.TextSize + dt
End If
Loop
ex.TextSize=ex.textsize *0.8
End Sub