Re: [Fxruby-users] FXSplitter Question
Status: Inactive
Brought to you by:
lyle
From: jeroen <je...@fo...> - 2004-06-16 22:26:39
|
On Wednesday 16 June 2004 10:29 am, Joseph wrote: > Hi. > > I'm using a splitter to horizontally divide the main window into two > horizontal areas, the top area, and the bottom area. The default > behavior, i.e. before the user plays with the splitter, shall be that > these two areas have the same height. However, I always get one area > that occupies the full frame, and the other area is completely shrunk. > If I use the SPLITTER_REVERSED option then the top area occupies the > full frame, and if I omit this option, then the top area is invisible > and the bottom area occupies the full frame. I've included the > PACK_UNIFORM_HEIGHT option into the splitter, but that didn't make a > difference either. To simplify the code, I've removed all content from > the two area frames. The sample code I'm using: > > @splitter = FXSplitter.new(self, > (LAYOUT_SIDE_TOP|LAYOUT_FILL_X|LAYOUT_FILL_Y | SPLITTER_VERTICAL| > SPLITTER_TRACKING|PACK_UNIFORM_HEIGHT)) > > area1 = FXVerticalFrame.new(@splitter, LAYOUT_SIDE_TOP|FRAME_THICK| > LAYOUT_FILL_X,0,0,0,0,0,0,0,0) > > area2 = FXVerticalFrame.new(@splitter, LAYOUT_SIDE_TOP|FRAME_THICK| > LAYOUT_FILL_X| LAYOUT_FILL_Y,0,0,0,0,0,0,0,0) > <<<<<<<<<<<<<<<<< > I've tried using LAYOUT_SIDE_BOTTOM on both area1 and area1 instead of > LAYOUT_SIDE_TOP, but that didn't appear to affect any modifications. > Also, I tried leaving out LAYOUT_FILL_Y from the top frame, then I tried > the same thing with the bottom frame, but modifying these options also > did not produce the desired results. > > Any ideas? What "holds the splitter up" is the child widgets. Think mostly of "giftwrapping" in the sense that the container widgets / layout managers normally shrink around their content widgets. Thus, with no content, some of the container widgets may become pretty small, unless you strut them up by internal padding or plainly fixing the width/height. In the case of FXSplitter, the size of the children can be set explicitly, and the FXSplitter will keep those sizes as set until the user moves them. The exception is the last widget, which is stretched to fill the remaining space. [In the case of SPLITTER_REVERSED that is the first widget]. One new twist that was added for 1.2 is that you can pass BOTH LAYOUT_FIX_WIDTH and LAYOUT_FILL_X and this unique (and unnatural looking) combination will be interpreted by FXSplitter to mean that the widget should not be smaller than its minimum size. Hope this helps, Regards, Jeroen -- +----------------------------------------------------------------------------+ | Copyright (C) 23:50 12/11/2003 Jeroen van der Zijp. All Rights Reserved. | +----------------------------------------------------------------------------+ |