Gtk.Widget.SetSizeRequest Method
Sets the minimum size of a widget; that is, the widget's size request will be width by height.

Syntax

public void SetSizeRequest (int width, int height)

Parameters

width
Width widget should request, or -1 to unset.
height
Weight widget should request, or -1 to unset.

Remarks

You can use this method to force a widget to be either larger or smaller than it normally would be. In most cases, Window.SetDefaultSize is a better choice for toplevel windows than this method; 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. When dealing with window sizes, Window.SetGeometryHints can be a useful method as well.

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 methoding 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.

Requirements

Namespace: Gtk
Assembly: gtk-sharp (in gtk-sharp.dll)