andlabs / andlabs/ui

ui.Entry event OnChanged doesn't fire for its SetText function

Abierto
#307 1 comentario 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Go
Estrellas
8.4k
Forks
639
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

Hi,
for me, the ui.Entry event OnChanged doesn't fire for its SetText function. My setup is like this:

```go
myInput = ui.NewEntry()
myOpenButton.OnClicked(func(_ *ui.Button) {
file := ui.OpenFile(window)
myInput.SetText(file)
})
myInput.OnChanged(func(_ *ui.Entry) {
fmt.Println(myInput.Text())
})
```
When I enter something manually in the entry field, the event gets fired just fine. But it doesn't fire for `myInput.SetText(file)`. Of course, I can easily work around that, just noticing. :)
Currently, it looks like this:

```go
myInputOnChanged := func(_ *ui.Entry) {
fmt.Println(myInput.Text())
}
myOpenButton.OnClicked(func(_ *ui.Button) {
file := ui.OpenFile(window)
myInput.SetText(file)
myInputOnChanged(nil)
})
myInput.OnChanged(myInputOnChanged)
```

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.