[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Sizing Widgets

WoodHacker

10/19/2006 6:30:00 PM

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

13 Answers

Marc Heiler

10/19/2006 7:11:00 PM

0

Can not help you but I would like to say that I am interested in an easy
solution as well, using ruby-gtk/gnome myself quite a lot.

--
Posted via http://www.ruby-....

Reid Thompson

10/19/2006 7:54:00 PM

0

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?Gt...

see section on child props

Reid Thompson

10/19/2006 7:55:00 PM

0

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
>
>
alternatively, use glade-2 and ruby-glade-create-template.

Gen the user interface with glade, setting props to expand/not expand
X/Y directions etc, then use ruby-glade-create-template to gen the
framework code.

WoodHacker

10/20/2006 3:20:00 PM

0


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?Gt...
>
> 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.

Reid Thompson

10/20/2006 5:43:00 PM

0

WoodHacker wrote:
> 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?Gt...
>>
>> 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.
>
>
>
what are the values of:

|query_child_packing(child)|
<http://ruby-gnome2.sourceforge.jp/hiki.cgi?Gt...#query_child_packing>
Returns information about how child is packed into box.

* Returns: [expand, fill, padding, pack_type]



WoodHacker

10/20/2006 10:32:00 PM

0


Reid Thompson wrote:
> WoodHacker wrote:
> > 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?Gt...
> >>
> >> 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.
> >
> >
> >
> what are the values of:
>
> |query_child_packing(child)|
> <http://ruby-gnome2.sourceforge.jp/hiki.cgi?Gt...#query_child_packing>
> Returns information about how child is packed into box.
>
> * Returns: [expand, fill, padding, pack_type]

I get false, false, 0, and a pack_type of 0 (start)

WoodHacker

10/20/2006 10:36:00 PM

0


Reid Thompson wrote:
> WoodHacker wrote:
> > 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?Gt...
> >>
> >> 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.
> >
> >
> >
> what are the values of:
>
> |query_child_packing(child)|
> <http://ruby-gnome2.sourceforge.jp/hiki.cgi?Gt...#query_child_packing>
> Returns information about how child is packed into box.
>

I should have said:

I get false, false, 0, 1 (start) fror the first three and true, true,
0, 1(start) for the last one.

> * Returns: [expand, fill, padding, pack_type]

Reid Thompson

10/21/2006 2:19:00 AM

0

WoodHacker wrote:
> Reid Thompson wrote:
>> WoodHacker wrote:
>>> 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?Gt...
>>>>
>>>> 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.
>>>
>>>
>>>
>> what are the values of:
>>
>> |query_child_packing(child)|
>> <http://ruby-gnome2.sourceforge.jp/hiki.cgi?Gt...#query_child_packing>
>> Returns information about how child is packed into box.
>>
>
> I should have said:
>
> I get false, false, 0, 1 (start) fror the first three and true, true,
> 0, 1(start) for the last one.
>
>> * Returns: [expand, fill, padding, pack_type]
>
>
A glade file that gives the effect that you want ( i believe -->
resizing the main window does not affect the size of the status bars in
cell 1 and 2 either way, the status bar in cell 3 will expand in
direction X)
A window with a 3x3 table.
row 3's cells each contain an Hbox
cell 1 and 2's Hbox's have explicitly set Height an Width
each hbox contains a status bar
properties of the hbox control the expansion of the cell see the packing
settings for the boxes below

<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd...

<glade-interface>

<widget class="GtkWindow" id="window1">
<property name="visible">True</property>
<property name="title" translatable="yes">window1</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="decorated">True</property>
<property name="skip_taskbar_hint">False</property>
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<property name="focus_on_map">True</property>
<property name="urgency_hint">False</property>

<child>
<widget class="GtkTable" id="table1">
<property name="visible">True</property>
<property name="n_rows">3</property>
<property name="n_columns">3</property>
<property name="homogeneous">False</property>
<property name="row_spacing">0</property>
<property name="column_spacing">0</property>

<child>
<widget class="GtkHBox" id="hbox2">
<property name="width_request">103</property>
<property name="height_request">16</property>
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>

<child>
<widget class="GtkStatusbar" id="statusbar2">
<property name="visible">True</property>
<property name="has_resize_grip">True</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>

<child>
<widget class="GtkHBox" id="hbox1">
<property name="width_request">103</property>
<property name="height_request">16</property>
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>

<child>
<widget class="GtkStatusbar" id="statusbar1">
<property name="visible">True</property>
<property name="has_resize_grip">True</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>

<child>
<widget class="GtkHBox" id="hbox3">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>

<child>
<widget class="GtkStatusbar" id="statusbar3">
<property name="visible">True</property>
<property name="has_resize_grip">True</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="y_options"></property>
</packing>
</child>
</widget>
</child>
</widget>

</glade-interface>



WoodHacker

10/23/2006 1:40:00 PM

0


Reid Thompson wrote:
> WoodHacker wrote:
> > Reid Thompson wrote:
> >> WoodHacker wrote:
> >>> 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?Gt...
> >>>>
> >>>> 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.
> >>>
> >>>
> >>>
> >> what are the values of:
> >>
> >> |query_child_packing(child)|
> >> <http://ruby-gnome2.sourceforge.jp/hiki.cgi?Gt...#query_child_packing>
> >> Returns information about how child is packed into box.
> >>
> >
> > I should have said:
> >
> > I get false, false, 0, 1 (start) fror the first three and true, true,
> > 0, 1(start) for the last one.
> >
> >> * Returns: [expand, fill, padding, pack_type]
> >
> >
> A glade file that gives the effect that you want ( i believe -->
> resizing the main window does not affect the size of the status bars in
> cell 1 and 2 either way, the status bar in cell 3 will expand in
> direction X)
> A window with a 3x3 table.
> row 3's cells each contain an Hbox
> cell 1 and 2's Hbox's have explicitly set Height an Width
> each hbox contains a status bar
> properties of the hbox control the expansion of the cell see the packing
> settings for the boxes below
>
> <?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
> <!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd...
>
> <glade-interface>
>
> <widget class="GtkWindow" id="window1">
> <property name="visible">True</property>
> <property name="title" translatable="yes">window1</property>
> <property name="type">GTK_WINDOW_TOPLEVEL</property>
> <property name="window_position">GTK_WIN_POS_NONE</property>
> <property name="modal">False</property>
> <property name="resizable">True</property>
> <property name="destroy_with_parent">False</property>
> <property name="decorated">True</property>
> <property name="skip_taskbar_hint">False</property>
> <property name="skip_pager_hint">False</property>
> <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
> <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
> <property name="focus_on_map">True</property>
> <property name="urgency_hint">False</property>
>
> <child>
> <widget class="GtkTable" id="table1">
> <property name="visible">True</property>
> <property name="n_rows">3</property>
> <property name="n_columns">3</property>
> <property name="homogeneous">False</property>
> <property name="row_spacing">0</property>
> <property name="column_spacing">0</property>
>
> <child>
> <widget class="GtkHBox" id="hbox2">
> <property name="width_request">103</property>
> <property name="height_request">16</property>
> <property name="visible">True</property>
> <property name="homogeneous">False</property>
> <property name="spacing">0</property>
>
> <child>
> <widget class="GtkStatusbar" id="statusbar2">
> <property name="visible">True</property>
> <property name="has_resize_grip">True</property>
> </widget>
> <packing>
> <property name="padding">0</property>
> <property name="expand">True</property>
> <property name="fill">True</property>
> </packing>
> </child>
> </widget>
> <packing>
> <property name="left_attach">1</property>
> <property name="right_attach">2</property>
> <property name="top_attach">2</property>
> <property name="bottom_attach">3</property>
> <property name="x_options">fill</property>
> <property name="y_options"></property>
> </packing>
> </child>
>
> <child>
> <widget class="GtkHBox" id="hbox1">
> <property name="width_request">103</property>
> <property name="height_request">16</property>
> <property name="visible">True</property>
> <property name="homogeneous">False</property>
> <property name="spacing">0</property>
>
> <child>
> <widget class="GtkStatusbar" id="statusbar1">
> <property name="visible">True</property>
> <property name="has_resize_grip">True</property>
> </widget>
> <packing>
> <property name="padding">0</property>
> <property name="expand">True</property>
> <property name="fill">True</property>
> </packing>
> </child>
> </widget>
> <packing>
> <property name="left_attach">0</property>
> <property name="right_attach">1</property>
> <property name="top_attach">2</property>
> <property name="bottom_attach">3</property>
> <property name="x_options">fill</property>
> <property name="y_options"></property>
> </packing>
> </child>
>
> <child>
> <widget class="GtkHBox" id="hbox3">
> <property name="visible">True</property>
> <property name="homogeneous">False</property>
> <property name="spacing">0</property>
>
> <child>
> <widget class="GtkStatusbar" id="statusbar3">
> <property name="visible">True</property>
> <property name="has_resize_grip">True</property>
> </widget>
> <packing>
> <property name="padding">0</property>
> <property name="expand">True</property>
> <property name="fill">True</property>
> </packing>
> </child>
> </widget>
> <packing>
> <property name="left_attach">2</property>
> <property name="right_attach">3</property>
> <property name="top_attach">2</property>
> <property name="bottom_attach">3</property>
> <property name="y_options"></property>
> </packing>
> </child>
> </widget>
> </child>
> </widget>
>
> </glade-interface>

I am sure this will work, but I would rather not use glade. It seems
rather bloated to add an XML layer to what should easily be done in
straight Ruby. I notice that in the glade code you use a
height_request property, which I have done in Ruby, but this only sets
up the initial height (and the minimal height) and does not seem to
effect enlarging the toplevel window. Why would the code work in
glade and not in Ruby?

WoodHacker

10/23/2006 1:48:00 PM

0


Reid Thompson wrote:
> WoodHacker wrote:
> > Reid Thompson wrote:
> >> WoodHacker wrote:
> >>> 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?Gt...
> >>>>
> >>>> 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.
> >>>
> >>>
> >>>
> >> what are the values of:
> >>
> >> |query_child_packing(child)|
> >> <http://ruby-gnome2.sourceforge.jp/hiki.cgi?Gt...#query_child_packing>
> >> Returns information about how child is packed into box.
> >>
> >
> > I should have said:
> >
> > I get false, false, 0, 1 (start) fror the first three and true, true,
> > 0, 1(start) for the last one.
> >
> >> * Returns: [expand, fill, padding, pack_type]
> >
> >
> A glade file that gives the effect that you want ( i believe -->
> resizing the main window does not affect the size of the status bars in
> cell 1 and 2 either way, the status bar in cell 3 will expand in
> direction X)
> A window with a 3x3 table.
> row 3's cells each contain an Hbox
> cell 1 and 2's Hbox's have explicitly set Height an Width
> each hbox contains a status bar
> properties of the hbox control the expansion of the cell see the packing
> settings for the boxes below
>
> <?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
> <!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd...
>
> <glade-interface>
>
> <widget class="GtkWindow" id="window1">
> <property name="visible">True</property>
> <property name="title" translatable="yes">window1</property>
> <property name="type">GTK_WINDOW_TOPLEVEL</property>
> <property name="window_position">GTK_WIN_POS_NONE</property>
> <property name="modal">False</property>
> <property name="resizable">True</property>
> <property name="destroy_with_parent">False</property>
> <property name="decorated">True</property>
> <property name="skip_taskbar_hint">False</property>
> <property name="skip_pager_hint">False</property>
> <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
> <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
> <property name="focus_on_map">True</property>
> <property name="urgency_hint">False</property>
>
> <child>
> <widget class="GtkTable" id="table1">
> <property name="visible">True</property>
> <property name="n_rows">3</property>
> <property name="n_columns">3</property>
> <property name="homogeneous">False</property>
> <property name="row_spacing">0</property>
> <property name="column_spacing">0</property>
>
> <child>
> <widget class="GtkHBox" id="hbox2">
> <property name="width_request">103</property>
> <property name="height_request">16</property>
> <property name="visible">True</property>
> <property name="homogeneous">False</property>
> <property name="spacing">0</property>
>
> <child>
> <widget class="GtkStatusbar" id="statusbar2">
> <property name="visible">True</property>
> <property name="has_resize_grip">True</property>
> </widget>
> <packing>
> <property name="padding">0</property>
> <property name="expand">True</property>
> <property name="fill">True</property>
> </packing>
> </child>
> </widget>
> <packing>
> <property name="left_attach">1</property>
> <property name="right_attach">2</property>
> <property name="top_attach">2</property>
> <property name="bottom_attach">3</property>
> <property name="x_options">fill</property>
> <property name="y_options"></property>
> </packing>
> </child>
>
> <child>
> <widget class="GtkHBox" id="hbox1">
> <property name="width_request">103</property>
> <property name="height_request">16</property>
> <property name="visible">True</property>
> <property name="homogeneous">False</property>
> <property name="spacing">0</property>
>
> <child>
> <widget class="GtkStatusbar" id="statusbar1">
> <property name="visible">True</property>
> <property name="has_resize_grip">True</property>
> </widget>
> <packing>
> <property name="padding">0</property>
> <property name="expand">True</property>
> <property name="fill">True</property>
> </packing>
> </child>
> </widget>
> <packing>
> <property name="left_attach">0</property>
> <property name="right_attach">1</property>
> <property name="top_attach">2</property>
> <property name="bottom_attach">3</property>
> <property name="x_options">fill</property>
> <property name="y_options"></property>
> </packing>
> </child>
>
> <child>
> <widget class="GtkHBox" id="hbox3">
> <property name="visible">True</property>
> <property name="homogeneous">False</property>
> <property name="spacing">0</property>
>
> <child>
> <widget class="GtkStatusbar" id="statusbar3">
> <property name="visible">True</property>
> <property name="has_resize_grip">True</property>
> </widget>
> <packing>
> <property name="padding">0</property>
> <property name="expand">True</property>
> <property name="fill">True</property>
> </packing>
> </child>
> </widget>
> <packing>
> <property name="left_attach">2</property>
> <property name="right_attach">3</property>
> <property name="top_attach">2</property>
> <property name="bottom_attach">3</property>
> <property name="y_options"></property>
> </packing>
> </child>
> </widget>
> </child>
> </widget>
>
> </glade-interface>

One other comment....

I am getting the same result with a menubar, which in affect is much
simpler than the statusbar we have been talking about. I have never
seen a menubar enlarge in height in any GUI system I have ever used,
and I have used a LOT of them. Unfortunately, the only examples of a
menubar I can find are done with glade. Shouldn't fixing the hight of
a menubar be part of the Gtk creation of a menubar? I'm confused.