Hi there,
This is how you register the event handler:
greetButton.AddEHandlerFunc(func(e gwu.Event) {
if e.Type() == gwu.ETypeClick {
outputLabel.SetText(nameTextBox.Text())
}
}, gwu.ETypeClick)
When you change some components in a handler, you have to tell gowut about them so gowut can take care of automatically rendering them again.
For this, use the Event.MarkDirty() method like this:
greetButton.AddEHandlerFunc(func(e gwu.Event) {
if e.Type() == gwu.ETypeClick {
outputLabel.SetText(nameTextBox.Text())
e.MarkDirty(outputLabel)
}
}, gwu.ETypeClick)
This will make it work.
Also note that if you register a handler with a single event type, you do not need to check it (it's redundant). So this handler does exactly what yours:
greetButton.AddEHandlerFunc(func(e gwu.Event) {
outputLabel.SetText(nameTextBox.Text())
}, gwu.ETypeClick)
Regards,
Andras