widget sizing and alignment



Things have been moving on...

If one studies the following pseudocode:-

<window name="main_window" sort="toplevel" height=400 width=840 />

<vbox name="logon1" pad=10>
        <hbox space=20>
                <vbox pad=5 width=400 height=300>
                        <hbox><label>Logon Type:        </label><field var="logon_type" /></hbox>
                        <hbox><label>Crew Ident 1:      </label><field var="crew_id1" width=4 /></hbox>
                        <hbox><label>Crew Ident 2:      </label><field var="crew_id2" width=4 /></hbox>
                        <hbox><label>Crew Ident 3:      </label><field var="crew_id3" width=4 /></hbox>
                        <hbox><label>Shift Code:        </label><field var="shift_code" width=2 /></hbox>
                        <hbox><label>Mileage:           </label><field var="mileage" width=8 /></hbox>
                </vbox>
                <vsep />
                <widget id="keypad" width=300 height=300 />
        </hbox>
        <hsep />
        <button name="book_on" width=75>Book On</button> 
</vbox>

<table name="keypad" width=300 height=300 equal=1>
 <tr><td><button name="1">1<td><button name="2">2<td><button name="3">3</tr> 
 <tr><td><button name="4">4<td><button name="5">5<td><button name="6">6</tr>
 <tr><td><button name="7">7<td><button name="8">8<td><button name="9">9</tr>
 <tr><td><button name="clear">Clear<td><button name="0">0<td><button name="Enter">Enter</tr> 
</table>

And you take it for granted that the table called "keypad" gets loaded
at the place marked <widget>, that each container ([hv]box or table) is
effectively $widget->pack_start(<thing>, 0, 0, 0) except where
overridden (eg pad=5). 

You get the screen shot attached. 

Not all the size requests are being honoured. Specifically the button
called 'book_on'. As you can see its width has been expanded even though
the vbox is created $vbox->new(0, 0) the packing call is
$vbox->pack_start($button, 0, 0, 10). I don't want the button that big.
Any suggestions?

I am also having a degree of misunderstanding about aligning text within
containers. Basically calling $widget->set_align(x,y) does not seem to
do a lot. Can someone show me an example in a table and in an hbox? 

The main reason this is important to me is for prompts like the screen
shot. Sometimes I want then left aligned (as shown) and sometime right
aligned next to the entry box (with some space between the label and the
box). 

Dirk




Attachment: example1.jpg
Description: JPEG image



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