summaryrefslogtreecommitdiff
path: root/window.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-06-11 09:42:11 -0400
committerPietro Gagliardi <[email protected]>2014-06-11 09:42:11 -0400
commit2407a415b955b514f086d5441e11c41b6dd41e1d (patch)
tree7d35fc8183616b75b65a89b006be043b173b171b /window.go
parent5fa1bd22e2d457523949e0e5e1dece729d053129 (diff)
parent4fa35b22391d56ba22725229f8d99f0061c910d0 (diff)
Merge pull request #17 from papplampe/master
added Center function to window + Windows implementation (thanks to @papplampe)
Diffstat (limited to 'window.go')
-rw-r--r--window.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/window.go b/window.go
index 02b33e9..f9c9337 100644
--- a/window.go
+++ b/window.go
@@ -120,3 +120,14 @@ func (w *Window) Hide() {
w.sysData.hide()
}
+
+// Centers the window
+func (w *Window) Center() {
+ w.lock.Lock()
+ defer w.lock.Unlock()
+
+ if !w.created {
+ return
+ }
+ w.sysData.center()
+}