[Fxruby-users] Re: Layout Manager questions in FxRuby
Status: Inactive
Brought to you by:
lyle
From: Lyle J. <ly...@kn...> - 2004-06-16 01:29:01
|
On Jun 15, 2004, at 10:28 AM, Richard Lionheart wrote: > The attached program is an example I got from Hal Fulton's book, or > rather, > from his publisher's web site. As the attached WordPad doc. shows with > three images (resulting from running an enhanced version with optional > arguments): > > 1. The original program presents a window that displays two buttons > arrayed > vertically. > 2. When an additional button is added, however, a narrower and > shorter > window is presented. > 3. When the second window is expanded by dragging its border, all > three > buttons become fully visible. > > This raises the following questions. > > 1. The default layout manager seems to be FXVerticalFrame. Is that > true? You're adding the buttons directly as children of the FXMainWindow; FXMainWindow is just a subclass of FXTopWindow. According to this page from the FOX documentation: http://www.fox-toolkit.com/layout.html the FXTopWindow "acts like an FXPacker window." I think that in your case it appears that it's using a vertical layout because the default layout hints for an FXButton are LAYOUT_SIDE_TOP and LAYOUT_SIDE_LEFT; in other words, unless you explicitly override those defaults, each new button will get "packed" to the top & left corner of the remaining space in the packer's cavity. > 2. The height of the window is appropriate when there are two > buttons, but > not when there are three. Why? Actually, the height of the window *is* appropriate when I run it here on my Mac (i.e. under X11). I will have to see if I can reproduce your problem under Windows and try to go from there. > 3. The width of the window is dictated by width of the last button > added. > True? No, I'm pretty sure the width of the window is dictated by the width of the widest button. > 4. I found some good documentation on Layout Managers at > http://www.eng.cse.dmu.ac.uk/~hgs/ruby/FXRuby/fox-1.0.40/doc/ > layout.html, > but it didn't answer the foregoing questions. Is there other helpful > on-line > documentation for layout managers? No, not that I know of. |