Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Update uiktest/main.go to include sizes, centered button #2

Merged
merged 1 commit into from

2 participants

@ajstarks

No description provided.

@skelterjohn skelterjohn merged commit f31ab51 into skelterjohn:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 17, 2012
  1. @ajstarks

    Update uiktest/main.go

    ajstarks authored
This page is out of date. Refresh to see the latest.
Showing with 14 additions and 5 deletions.
  1. +14 −5 uiktest/main.go
View
19 uiktest/main.go
@@ -1,17 +1,26 @@
package main
import (
- // "fmt"
+ "fmt"
"github.com/skelterjohn/go.uik"
)
func main() {
- w, err := uik.NewWindow(nil, 200, 200)
+ width := 480.0
+ height := 320.0
+ w, err := uik.NewWindow(nil, int(width), int(height))
if err != nil {
- panic(err)
+ fmt.Println(err)
+ return
}
- w.W.SetTitle("go.uik")
- b := uik.NewButton("Hi")
+ w.W.SetTitle("GoUI")
+
+ bw := width/4
+ bh := width/4
+ borigin := uik.Coord{width/2 - bw/2, height/2 - bh/2}
+ bsize := uik.Coord{bw, bh}
+
+ b := uik.NewButton(borigin, bsize, "Hi")
w.AddBlock(&b.Block)
w.Show()
<-w.Done
Something went wrong with that request. Please try again.