diff options
| author | faiface <faiface@ksp.sk> | 2017-08-18 21:23:24 +0200 |
|---|---|---|
| committer | faiface <faiface@ksp.sk> | 2017-08-18 21:23:24 +0200 |
| commit | 252ed0faad97bbbed3263c1644c10d1ed7cda5d6 (patch) | |
| tree | 54a2c94b56729991ec1f95573e3f24b602642b6f | |
| parent | 03403e80262cd4ecfbfdada0aac23882e27d0ef4 (diff) | |
| download | gui-252ed0faad97bbbed3263c1644c10d1ed7cda5d6.zip | |
win: minor change
| -rw-r--r-- | win/win.go | 54 |
1 files changed, 27 insertions, 27 deletions
@@ -11,6 +11,33 @@ import ( "github.com/go-gl/glfw/v3.2/glfw" ) +type Option func(*options) + +type options struct { + title string + width, height int + resizable bool +} + +func Title(title string) Option { + return func(o *options) { + o.title = title + } +} + +func Size(width, height int) Option { + return func(o *options) { + o.width = width + o.height = height + } +} + +func Resizable() Option { + return func(o *options) { + o.resizable = true + } +} + func New(opts ...Option) (*Win, error) { o := options{ title: "", @@ -85,33 +112,6 @@ func makeGLFWWin(o *options) (*glfw.Window, error) { return w, nil } -type Option func(*options) - -func Title(title string) Option { - return func(o *options) { - o.title = title - } -} - -func Size(width, height int) Option { - return func(o *options) { - o.width = width - o.height = height - } -} - -func Resizable() Option { - return func(o *options) { - o.resizable = true - } -} - -type options struct { - title string - width, height int - resizable bool -} - type Win struct { event.Dispatch w *glfw.Window |