ui
ui copied to clipboard
textfield .RequestFocus()
Hello, I've been using https://github.com/dontpanic92/wxGo for a while but moving to this system and it's great! The one thing I'm missing is making a textfield have the blinking cursor with a request focus call. I was thinking about using:
https://github.com/go-vgo/robotgo
To simulate a mouse click inside the textfield. Is this a bad idea?
oh, I see. If I do:
mainwin.Destroy()
mainwin = ui.NewWindow("Testing", 800, 480, true)
mainwin.SetChild(child)
mainwin.Show()
My textfield has focus!
This is the wrong solution. There should be a SetFocus function at some point (not yet), though I don't know why the field isn't getting focus by default if you are creating it before the window is first shown.
I make a window, place a button there to say "start". Then the event for that button clears the screen and adds a textfield. But the textfield has no focus when I do it that way. Only when I remove the mainwindow on start button click. (Or have a textfield on that first screen with the start button)
Yeah, so I'll need to add a SetFocus function, which isn't even in libui yet.