diff --git a/.air.toml b/.air.toml index d7ff5c6..c46b56f 100644 --- a/.air.toml +++ b/.air.toml @@ -5,7 +5,7 @@ tmp_dir = "tmp" [build] args_bin = [] bin = "tmp\\main.exe" - cmd = "go build -o ./tmp/main.exe ./example" + cmd = "go build -ldflags='-H windowsgui' -o ./tmp/main.exe ./example" delay = 1000 exclude_dir = ["assets", "tmp", "vendor", "testdata", "runtime/out", "node_modules", "dist"] exclude_file = [] diff --git a/README.md b/README.md index 9c14362..a2fc14f 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,20 @@ func main() { } ``` +## Building + +### Windows +Windows users should use the `-ldflags='-H windowsgui'` flag to avoid showing a console window when running the app. +``` +go build -ldflags='-H windowsgui' ./example +``` + +### *nix +``` +go build ./example +``` + + ## Contributing & Development ``` git clone ssh://git@git.iwakura.rip:6969/grng/tiramisu.git diff --git a/tiramisu.go b/tiramisu.go index 5fc900d..a2c0173 100644 --- a/tiramisu.go +++ b/tiramisu.go @@ -25,14 +25,14 @@ type Tiramisu struct { func New(o TiramisuOptions) *Tiramisu { w := wv.New(o.Debug) + w.SetSize(o.Width, o.Height, o.Hints) + w.SetTitle(o.Title) + t := &Tiramisu{ w: w, funcs: make(map[string]FuncHandler), } - w.SetSize(o.Width, o.Height, o.Hints) - w.SetTitle(o.Title) - return t }