- width
- Width in pixels, or -1 to unset the default width.
- height
- Height in pixels, or -1 to unset the default height.
If the window's "natural" size (its size request) is larger than the default, the default will be ignored. More generally, if the default size does not obey the geometry hints for the window (Window.SetGeometryHints can be used to set these explicitly), the default size will be clamped to the nearest permitted size.
Unlike Widget.SetSizeRequest which sets a size request for a widget and thus would keep users from shrinking the window, this method only sets the initial size, just as if the user had resized the window themselves. Users can still shrink the window again as they normally would. Setting a default size of -1 means to use the "natural" default size (the size request of the window).
For more control over a window's initial size and how resizing works, investigate Window.SetGeometryHints.
For some uses, Window.Resize is a more appropriate method. Window.Resize changes the current size of the window, rather than the size to be used on initial display. Window.Resize always affects the window itself, not the geometry widget.
The default size of a window only affects the first time a window is shown; if a window is hidden and re-shown, it will remember the size it had prior to hiding, rather than using the default size.