def update_min_size(widget, width=None, height=None, size=None):
    """Utility function to set minimum width/height of a widget."""
    size = size or widget.GetMinSize()
    if width:  size.SetWidth( max(width,  size.GetWidth()))
    if height: size.SetHeight(max(height, size.GetHeight()))
    widget.SetMinSize(size)
    return size