# Sizer problem

**URL:** <https://www.ruby-forum.com/t/sizer-problem/142365>\
**Category:** wxRuby\
**Created:** [July 7, 2008, 11:04am UTC](https://www.ruby-forum.com/t/sizer-problem/142365 "2008-07-07T11:04:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lcyeap](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/9fc348/32.png) [@lcyeap](https://www.ruby-forum.com/u/lcyeap)\
**Post date:** [July 7, 2008, 11:04am UTC](https://www.ruby-forum.com/t/sizer-problem/142365/1 "2008-07-07T11:04:24Z")

</div>

Greetings,

Currenly i am trying to display a grid at the bottom of my GUI when a  
button is clicked. However, the original frame size will not be auto  
adjusted. it makes the GUI looks ugly and not user friendly as they need  
to use cursor to resize it. May i know is there any command that i can  
use to solve this problem? any method to adjust the frame after  
evt\_button generate a grid at the bottom? thanks a lot.

---

<div class="post-metadata">

**Author:** ![lcyeap](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/9fc348/32.png) [@lcyeap](https://www.ruby-forum.com/u/lcyeap)\
**Post date:** [July 8, 2008, 1:20pm UTC](https://www.ruby-forum.com/t/sizer-problem/142365/2 "2008-07-08T13:20:54Z")

</div>

You are looking for the fit() method.

From the docs:  
window.Fit(): The Fit() method sets the size of a window to fit around  
its children. If it has no children then nothing is done, if it does  
have children then the size of the window is set to the window’s best  
size.

[http://docs.wxwidgets.org/stable/wx\_windowsizingoverview.html#windowsizingoverview](http://docs.wxwidgets.org/stable/wx_windowsizingoverview.html#windowsizingoverview)

and  
[http://wxruby.rubyforge.org/doc/window.html#Window\_fit](http://wxruby.rubyforge.org/doc/window.html#Window_fit)

ps. frames that resize themselves aren’t really considered user-friendly  
either.

Best of luck,  
Jonathan

(I’m really really starting to hate Thunderbird, 4th time I sent this  
message now)
