Re: [Fxruby-users] Frames not obeying width/height?
Status: Inactive
Brought to you by:
lyle
From: Sander J. <sa...@kn...> - 2003-12-15 05:37:27
|
What you probably want: Left Frame - needs to take up as much space as possible - > LAYOUT_FILL_X|LAYOUT_FILL_Y Right Frame - Only needs to take up space that it requires, though we want to take as much height as there is -> LAYOUT_FILL_Y Now... the size of the right frame is determined by its contents. If you don't put anything in there the width will be 1. So make sure if you test it, you put something in there (like a button for example). If you really insist on having a fixed width (bad practice, fonts may change size and some things won't fit anymore), you have to pass the LAYOUT_FIX_WIDTH or LAYOUT_FIX_HEIGHT and pass the required size in the constructor of the widget (or later using setWidth or setHeight). Note, you can leave the LAYOUT_TOP and LAYOUT_LEFT since they don't influence anything here. Also read the documentation on layout managers: http://www.fox-toolkit.org/layout.html Hope this helps, Sander On Sunday 14 December 2003 10:55 pm, Carl Youngblood wrote: > I'm having a problem getting my application to space things the way I > want them. I basically have one horizontal frame that contains > everything. Inside that I have left and right vertical frames. The > left frame I want to contain an iconlist, and I want it take up most of > the space. The right frame will contain a basic list with some buttons > below it, and I only need it to be as wide as the widest item in the > list. So I want it to be fairly narrow. The following code makes the > right and left frames equal size, which scrunches the iconlist and gives > way too much room to the right-hand list. However, when I try to remove > the LAYOUT_FILL_X options from the right and left frames, the lists > occupy the opposite edges and are very narrow, leaving a huge gap of > nothing in the middle. > > I tried leaving the left frame set to LAYOUT_FILL_X and hard-coding the > width of the right frame, but it seems to completely ignore my size > settings and leave very little room for the right-hand frame. Any ideas? > > Thanks, > Carl > > Here is the code: > ---------------------------- > > contents = FXHorizontalFrame.new(self, > LAYOUT_SIDE_TOP|LAYOUT_FILL_X|LAYOUT_FILL_Y, > 0, 0, 0, 0, 0, 0, 0, 0) > > leftframe = FXVerticalFrame.new(contents, > LAYOUT_FILL_Y|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_FILL_X, > 0, 0, 0, 0, 0, 0, 0, 0) > FXLabel.new(leftpane, "Transactions", nil, LAYOUT_FILL_X) > > # Transaction view window > transframe = FXVerticalFrame.new(leftframe, > > FRAME_SUNKEN|FRAME_THICK|LAYOUT_FILL_X|LAYOUT_FILL_Y|LAYOUT_TOP|LAYOUT_LEFT >, 0, 0, 0, 0, 0, 0, 0, 0) > > FXVerticalSeparator.new(contents, SEPARATOR_RIDGE|LAYOUT_FILL_Y) > > rightframe = FXVerticalFrame.new(contents, > LAYOUT_TOP|LAYOUT_RIGHT, > 0, 0, 150, 200, 0, 0, 0, 0) > FXLabel.new(rightframe, "Categories", nil, LAYOUT_FILL_X) > > catlistframe = FXVerticalFrame.new(rightframe, > FRAME_SUNKEN|FRAME_THICK|LAYOUT_TOP|LAYOUT_LEFT|LAYOUT_FILL_X, > 0, 0, 0, 0, 0, 0, 0, 0) > > @catlist = FXList.new(catlistframe, 20, nil, 0, > LAYOUT_FILL_X|LAYOUT_FILL_Y|LIST_SINGLESELECT) > @catlist.appendItem("Text") > > @translist = FXIconList.new(transframe, nil, 0, > LAYOUT_FILL_X|LAYOUT_FILL_Y|ICONLIST_BROWSESELECT) > @translist.appendHeader("Date", nil, 75) > @translist.appendHeader("Check", nil, 50) > @translist.appendHeader("Amount", nil, 75) > @translist.appendHeader("Payee", nil, 250) > @translist.appendHeader("Category", nil, 150) > @translist.appendHeader("Result", nil, 150) -- "I've had a wonderful time, but this wasn't it." - Groucho Marx (1895-1977) |