app: add Window.Maximize and Center, add Windows implementation

Signed-off-by: Jan Kare Vatne <jkvatne@online.no>
This commit is contained in:
Jan Kåre Vatne
2021-11-10 13:56:08 +01:00
committed by Elias Naur
parent dce453e130
commit 9835cd5996
10 changed files with 98 additions and 0 deletions
+16
View File
@@ -311,6 +311,22 @@ func (w *Window) Close() {
})
}
// Maximize the window.
// Note: only implemented on Windows.
func (w *Window) Maximize() {
w.driverDefer(func(d driver) {
d.Maximize()
})
}
// Center the window.
// Note: only implemented on Windows.
func (w *Window) Center() {
w.driverDefer(func(d driver) {
d.Center()
})
}
// Run f in the same thread as the native window event loop, and wait for f to
// return or the window to close. Run is guaranteed not to deadlock if it is
// invoked during the handling of a ViewEvent, system.FrameEvent,