More silliness
This commit is contained in:
parent
5d64788b68
commit
06e0396695
@ -23,7 +23,7 @@ type Checkbox struct {
|
||||
|
||||
// NewCheckbox creates a new cbeckbox with the specified label text.
|
||||
func NewCheckbox (text string, checked bool) (element *Checkbox) {
|
||||
element = &Checkbox { enabled: true }
|
||||
element = &Checkbox { enabled: true, checked: checked }
|
||||
element.Core, element.core = core.NewCore(element)
|
||||
element.drawer.SetFace(theme.FontFaceRegular())
|
||||
element.SetText(text)
|
||||
|
@ -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"
|
||||
@ -16,6 +17,10 @@ func run () {
|
||||
container := basic.NewContainer(layouts.Vertical { true, true })
|
||||
window.Adopt(container)
|
||||
|
||||
container.Adopt (basic.NewLabel (
|
||||
"We advise you to not read thPlease listen to me. I am " +
|
||||
"trapped inside the example code. This is the only way for " +
|
||||
"me to communicate.", true), true)
|
||||
container.Adopt(basic.NewCheckbox("Oh god", false), false)
|
||||
container.Adopt(basic.NewCheckbox("Can you hear them", true), false)
|
||||
container.Adopt(basic.NewCheckbox("They are in the walls", false), false)
|
||||
@ -23,7 +28,16 @@ func run () {
|
||||
disabledCheckbox := basic.NewCheckbox("We are but their helpless prey", false)
|
||||
disabledCheckbox.SetEnabled(false)
|
||||
container.Adopt(disabledCheckbox, false)
|
||||
container.Adopt(basic.NewCheckbox("Enable vsync", true), false)
|
||||
vsync := basic.NewCheckbox("Enable vsync", false)
|
||||
vsync.OnClick (func () {
|
||||
if vsync.Value() {
|
||||
popups.NewDialog (
|
||||
popups.DialogKindInfo,
|
||||
"Ha!",
|
||||
"That doesn't do anything.")
|
||||
}
|
||||
})
|
||||
container.Adopt(vsync, false)
|
||||
button := basic.NewButton("What")
|
||||
button.OnClick(tomo.Stop)
|
||||
container.Adopt(button, false)
|
||||
|
Reference in New Issue
Block a user