def resize_to_fit(cols, rows = nil)
      rows ||= cols
      change_geometry(Geometry.new(cols, rows)) do |ncols, nrows|
        resize(ncols, nrows)
      end
    end
def resize_to_fit(cols, rows = nil)
      rows ||= cols
      change_geometry(Geometry.new(cols, rows)) do |ncols, nrows|
        resize(ncols, nrows)
      end
    end
Convenience method to resize retaining the aspect ratio.
 (Thanks to Robert Manni!)