Re-organized module structure
This commit is contained in:
@@ -3,8 +3,8 @@ package main
|
||||
import "time"
|
||||
import "git.tebibyte.media/sashakoshka/tomo"
|
||||
import "git.tebibyte.media/sashakoshka/tomo/popups"
|
||||
import "git.tebibyte.media/sashakoshka/tomo/layouts/basic"
|
||||
import "git.tebibyte.media/sashakoshka/tomo/elements/basic"
|
||||
import "git.tebibyte.media/sashakoshka/tomo/layouts"
|
||||
import "git.tebibyte.media/sashakoshka/tomo/elements"
|
||||
import "git.tebibyte.media/sashakoshka/tomo/elements/containers"
|
||||
import _ "git.tebibyte.media/sashakoshka/tomo/backends/all"
|
||||
|
||||
@@ -15,23 +15,23 @@ func main () {
|
||||
func run () {
|
||||
window, _ := tomo.NewWindow(2, 2)
|
||||
window.SetTitle("Approaching")
|
||||
container := containers.NewContainer(basicLayouts.Vertical { true, true })
|
||||
container := containers.NewContainer(layouts.Vertical { true, true })
|
||||
window.Adopt(container)
|
||||
|
||||
container.Adopt (basicElements.NewLabel (
|
||||
container.Adopt (elements.NewLabel (
|
||||
"Rapidly approaching your location...", false), false)
|
||||
bar := basicElements.NewProgressBar(0)
|
||||
bar := elements.NewProgressBar(0)
|
||||
container.Adopt(bar, false)
|
||||
button := basicElements.NewButton("Stop")
|
||||
button := elements.NewButton("Stop")
|
||||
button.SetEnabled(false)
|
||||
container.Adopt(button, false)
|
||||
|
||||
window.OnClose(tomo.Stop)
|
||||
window.Show()
|
||||
go fill(bar)
|
||||
go fill(window, bar)
|
||||
}
|
||||
|
||||
func fill (bar *basicElements.ProgressBar) {
|
||||
func fill (window tomo.Window, bar *elements.ProgressBar) {
|
||||
for progress := 0.0; progress < 1.0; progress += 0.01 {
|
||||
time.Sleep(time.Second / 24)
|
||||
tomo.Do (func () {
|
||||
@@ -41,6 +41,7 @@ func fill (bar *basicElements.ProgressBar) {
|
||||
tomo.Do (func () {
|
||||
popups.NewDialog (
|
||||
popups.DialogKindInfo,
|
||||
window,
|
||||
"I am here",
|
||||
"Don't look outside your window.")
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user