From: WoodHacker Date: 2006-10-21T00:25:09+09:00 Subject: Re: Sizing Widgets Reid Thompson wrote: > On Fri, 2006-10-20 at 03:35 +0900, WoodHacker wrote: > > I'm new to Ruby/Gtk and find it, so far, exactly what I want for a GUI. > > However, I have one problem that I can't seem to figure out and that > > has to do with setting sizes of widgets. For example, I want to > > create a status bar with four display areas. I can use an HBox for > > the container and use four status bars for the info. Works great. > > I can set the first three to be small for position data and the fourth > > one to be long for general messages. Done all the time. (there may > > be a better way to do this, but it works) > > > > However, if the user resizes the main window, the statusbars stretch in > > all directions, including height. I want only the last area to > > stretch and it only in width. Setting height and width_requests seem > > to only affect shrinking the window. > > > > I'm having the same problem with my menubar - it stretches in height > > when the window is resized. There has to be an easy fix to this, but > > so far it eludes me. > > > > Bill > > > > > http://ruby-gnome2.sourceforge.jp/hiki.cgi?Gtk%3A%3ABox > > see section on child props In the statusbar code, I'm using pack_start as defined in the section you quote. And I get the status boxes to remain stable in the x direction. In other words, the first three boxes stay in their fixed size and the fourth one enlarges. The problem is with the y direction. All the boxes grow in the y direction. This also happens with my menubar. And I believe the menubar doesn't allow you to use pack - it wants append, which gives you no control at all.