set_size_request


Description:

public void set_size_request (int width, int height)

Sets the minimum size of a widget.

That is, the widget’s size request will be at least width by height. You can use this function to force a widget to be larger than it normally would be.

In most cases, [[email protected]_default_size] is a better choice for toplevel windows than this function; setting the default size will still allow users to shrink the window. Setting the size request will force them to leave the window at least as large as the size request.

Note the inherent danger of setting any fixed size - themes, translations into other languages, different fonts, and user action can all change the appropriate size for a given widget. So, it's basically impossible to hardcode a size that will always be correct.

The size request of a widget is the smallest size a widget can accept while still functioning well and drawing itself correctly. However in some strange cases a widget may be allocated less than its requested size, and in many cases a widget may be allocated more space than it requested.

If the size request in a given direction is -1 (unset), then the “natural” size request of the widget will be used instead.

The size request set here does not include any margin from the properties [[email protected]:margin-start], [ [email protected]:margin-end], [[email protected]:margin-top], and [[email protected]:margin-bottom], but it does include pretty much all other padding or border properties set by any subclass of `GtkWidget`.

Parameters:

this

a `GtkWidget`

width

width this should request, or -1 to unset

height

height this should request, or -1 to unset




2022 vala-language.org