Open Bigjango13 opened 2 years ago
Because of some doubt about compatibility with volt
, I did not want to change on_change
but preferred introduce on_changed
like in the modified code.
module main
import ui
struct App {
mut:
window &ui.Window = 0
}
fn print_change(tb &ui.TextBox, a voidptr) {
println(*(tb.text))
}
fn main() {
mut app := &App{}
app.window = ui.window(
children: [
ui.column(children: [
ui.textbox(
placeholder: 'Enter a some text'
on_changed: print_change
),
])
]
)
ui.run(app.window)
}
Also notice the ui.column
layout to fit automatically textbox..
V version: V 0.2.4 506259a.6da3004 UI version: 0.0.4 OS: Linux, Ubuntu 18.04.5 LTS (VM) What did you do?
I ran it, and typed "Hello" and then hit Backspace until it was gone.
What did you expect to see?
What did you see instead?