[fxruby-users] FXMDIChild shrinkwrap to content

Lyle Johnson lyle.johnson at gmail.com
Sun May 20 19:04:22 EDT 2007

On 5/17/07, Joel VanderWerf <vjoel at path.berkeley.edu> wrote:

> How can I get a FXMDIChild to shrinkwrap to its content?
> Here's what I'm doing now:
>    def create(*)
>      self.height = maxChildHeight + 30
>      self.width = maxChildWidth + 10
>      super
>    end
> This works, but I'm not crazy about manually adjusting for (apparently)
> frame and title bar sizes.

This is only marginally better, but I think you could instead do:

    self.height = defaultHeight + maxChildHeight
    self.width = defaultWidth + maxChildWidth

The defaultHeight and defaultWidth return values should take care of
the dimensions of the window's decorations (title bar, etc.)

Hope this helps,


More information about the fxruby-users mailing list