I create a button_loud and I pass a default text like. Then I set a new value and subscribe to OnClick
TextForMyUI<localizes> : message = "T"
TileButton : button_loud = button_loud{DefaultText := TextForMyUI}
TileButton.SetText(SetMessage(ToString(Number)))
TileButton.OnClick().Subscribe(HandleTileButtonClick)
In the HandleTileButtonClick I try to access the Text of the button like
HandleTileButtonClick(Message: widget_message) : void =
Print("Button Clicked")
if(Button := button_loud[Message.Source]):
Print(Button.GetText())
but it returns the DefaultText and not the Number I’m setting
Any ideas what I’m doing wrong?
SetTextMessage:
SetMessage<localizes>(MyMessage:string) : message = { "{MyMessage}" }