Example files now reflect new API change

This commit is contained in:
Sasha Koshka 2023-01-30 17:25:09 -05:00
parent 801c3ef6f5
commit 58c3b23a99
6 changed files with 12 additions and 12 deletions

View File

@ -42,7 +42,7 @@ func run () {
button := basic.NewButton("What") button := basic.NewButton("What")
button.OnClick(tomo.Stop) button.OnClick(tomo.Stop)
container.Adopt(button, false) container.Adopt(button, false)
button.Select() button.Focus()
window.OnClose(tomo.Stop) window.OnClose(tomo.Stop)
window.Show() window.Show()

View File

@ -22,7 +22,7 @@ func run () {
container.Adopt(cancel, false) container.Adopt(cancel, false)
okButton := basic.NewButton("OK") okButton := basic.NewButton("OK")
container.Adopt(okButton, false) container.Adopt(okButton, false)
okButton.Select() okButton.Focus()
window.OnClose(tomo.Stop) window.OnClose(tomo.Stop)
window.Show() window.Show()

View File

@ -35,7 +35,7 @@ func run () {
container.Adopt(button0, false) container.Adopt(button0, false)
container.Adopt(button1, false) container.Adopt(button1, false)
container.Adopt(button2, false) container.Adopt(button2, false)
button0.Select() button0.Focus()
}) })
}, },
"wet": func () { "wet": func () {
@ -52,7 +52,7 @@ func run () {
container.Adopt(label, true) container.Adopt(label, true)
container.Adopt(button0, false) container.Adopt(button0, false)
container.Adopt(button1, false) container.Adopt(button1, false)
button0.Select() button0.Focus()
}) })
}, },
"house": func () { "house": func () {
@ -69,7 +69,7 @@ func run () {
container.Adopt(label, true) container.Adopt(label, true)
container.Adopt(button1, false) container.Adopt(button1, false)
container.Adopt(button0, false) container.Adopt(button0, false)
button1.Select() button1.Focus()
}) })
}, },
"inside": func () { "inside": func () {
@ -86,7 +86,7 @@ func run () {
container.Warp (func () { container.Warp (func () {
container.Adopt(label, true) container.Adopt(label, true)
container.Adopt(button0, false) container.Adopt(button0, false)
button0.Select() button0.Focus()
}) })
}, },
"bear": func () { "bear": func () {
@ -103,7 +103,7 @@ func run () {
container.Adopt(label, true) container.Adopt(label, true)
container.Adopt(button0, false) container.Adopt(button0, false)
container.Adopt(button1, false) container.Adopt(button1, false)
button0.Select() button0.Focus()
}) })
}, },
} }

View File

@ -27,7 +27,7 @@ func run () {
"You are wacky") "You are wacky")
}) })
container.Adopt(infoButton, false) container.Adopt(infoButton, false)
infoButton.Select() infoButton.Focus()
questionButton := basic.NewButton("popups.DialogKindQuestion") questionButton := basic.NewButton("popups.DialogKindQuestion")
questionButton.OnClick (func () { questionButton.OnClick (func () {

View File

@ -25,14 +25,14 @@ func run () {
container.Adopt(basic.NewLabel("Draw here:", false), false) container.Adopt(basic.NewLabel("Draw here:", false), false)
container.Adopt(testing.NewMouse(), true) container.Adopt(testing.NewMouse(), true)
container.Adopt(okButton, false) container.Adopt(okButton, false)
okButton.Select() okButton.Focus()
}) })
okButton.OnClick(tomo.Stop) okButton.OnClick(tomo.Stop)
container.Adopt(label, true) container.Adopt(label, true)
container.Adopt(button, false) container.Adopt(button, false)
container.Adopt(okButton, false) container.Adopt(okButton, false)
okButton.Select() okButton.Focus()
window.OnClose(tomo.Stop) window.OnClose(tomo.Stop)
window.Show() window.Show()

View File

@ -43,7 +43,7 @@ func NewDialog (
button := basic.NewButton("OK") button := basic.NewButton("OK")
button.OnClick(window.Close) button.OnClick(window.Close)
container.Adopt(button, false) container.Adopt(button, false)
button.Select() button.Focus()
} else { } else {
var button *basic.Button var button *basic.Button
for _, buttonDescriptor := range buttons { for _, buttonDescriptor := range buttons {
@ -55,7 +55,7 @@ func NewDialog (
}) })
container.Adopt(button, false) container.Adopt(button, false)
} }
button.Select() button.Focus()
} }
window.Show() window.Show()