Silliness increase

This commit is contained in:
Sasha Koshka 2023-01-18 01:29:59 -05:00
parent 46268c8d02
commit 48db645f9f
2 changed files with 14 additions and 1 deletions

View File

@ -183,6 +183,10 @@ func (element *TextBox) SetText (text string) {
}
}
func (element *TextBox) Value () (value string) {
return string(element.text)
}
func (element *TextBox) draw () {
bounds := element.core.Bounds()

View File

@ -1,6 +1,7 @@
package main
import "git.tebibyte.media/sashakoshka/tomo"
import "git.tebibyte.media/sashakoshka/tomo/popups"
import "git.tebibyte.media/sashakoshka/tomo/layouts"
import "git.tebibyte.media/sashakoshka/tomo/elements/basic"
import _ "git.tebibyte.media/sashakoshka/tomo/backends/x"
@ -17,9 +18,17 @@ func run () {
firstName := basic.NewTextBox("First name", "")
lastName := basic.NewTextBox("Last name", "")
lastName.SetEnabled(false)
fingerLength := basic.NewTextBox("Length of fingers", "")
button := basic.NewButton("Ok")
lastName.SetEnabled(false)
button.OnClick (func () {
popups.NewDialog (
popups.DialogKindInfo,
"Profile",
firstName.Value() + " [REDACTED]'s fingers\n" +
"measure in at " + fingerLength.Value() + " feet.")
})
container.Adopt(basic.NewLabel("Choose your words carefully.", false), true)
container.Adopt(firstName, false)