mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 02:15:34 +00:00
ui/app,apps/gophers,apps/hello: accept nil WindowOptions in NewWindow
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+8
-1
@@ -64,7 +64,14 @@ var extraArgs string
|
||||
// ignore or adjust them.
|
||||
// If the current program is running on iOS and Android,
|
||||
// NewWindow the window previously created by the platform.
|
||||
func NewWindow(opts WindowOptions) (*Window, error) {
|
||||
func NewWindow(opts *WindowOptions) (*Window, error) {
|
||||
if opts == nil {
|
||||
opts = &WindowOptions{
|
||||
Width: ui.Dp(800),
|
||||
Height: ui.Dp(600),
|
||||
Title: "Gio program",
|
||||
}
|
||||
}
|
||||
if opts.Width.V <= 0 || opts.Height.V <= 0 {
|
||||
panic("window width and height must be larger than 0")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user