Re: expanding horizontally but not vertically



On Sun, 25 Mar 2001 10:44:35 -0500, Paul Davis wrote:

>In message <20010325153753 HQOB22998 mailhost chi ameritech net bbs dbsoft-cons
>ulting.com>you write:
>>	Is it possible to pack widgets into a box that expands horizontally but
>> not 
>>vertically (or vice versa).  I can stop a widget from expanding by calling 
>>gtk_widget_set_usize(widget, 0, 20);  to make it expand horizontally but not 
>>vertically, however the box it's in expands vertically anyway.  Calling 
>>gtk_widget_set_usize() like that on the box does not stop it from expanding.  
>>Is it 
>>possible to do this? 
>
>GtkWidget *your_widget = ....;
>
>GtkWidget *hbox = gtk_hbox_new ();
>GtkWidget *vbox = gtk_vbox_new ();
>
>/* pack your_widget into a hbox with no padding, no filling, no
>   expansion. it doesn't expand horizontally anymore.
> */
>
>gtk_box_pack_start (GTK_BOX(hbox), your_widget, false, false, 0);
>
>/* pack your_widget into a vbox with no padding, no filling, no
>   expansion. it doesn't expand vertically anymore.
> */
>
>gtk_box_pack_start (GTK_BOX(vbox), your_widget, false, false, 0);
>
>/* do both */
>
>gtk_box_pack_start (GTK_BOX(hbox), your_widget, false, false, 0);
>gtk_box_pack_start (GTK_BOX(vbox), hbox, false, false, 0);

I've read over this code numerous times and I don't see how it will
expand at all?  Let me give an example:

<please view with a fixed width font>

+---------------------------------------------+
|Username: <Entryfield> Password: <Entryfield>|
+----------------------+----------------------+
|                      |                      |
|                      |                      |
|  This should expand  |  So should this      |
|                      |                      |
|                      |                      |
|                      |                      |
|                      |                      |
|                      |                      |
+----------------------+----------------------+
| Status line                                 |
+---------------------------------------------+

This is a simplified view of my window, I want the entryfields to
expand horizontally, but not the text "username" and "password", 
and nothing in that box should expand vertically.  The status
line text should also expand horizontally but not vertically.  
The two boxes in the middle which show information about the
server and are clists should expand both horizontally and 
vertically.  

Thanks... and thanks for the quick reply.

Brian Smith





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]