Re: Swi-Pce: text items too large

From: Jan Wielemaker (jan_at_ct.xs4all.nl)
Date: 01/31/05

  • Next message: Jan Wielemaker: "Re: Help. invoke a swi-prolog program within an html page"
    Date: 31 Jan 2005 16:32:08 GMT
    
    

    On 2005-01-31, Maurizio Ferreira <maurizio.ferreira@selesta.it> wrote:
    > the following program exibits a strange behaviour :
    > the horizontal size of the text_items seems exagerately large.
    > if I remove the 'right' specifier in the second append clause, the
    > sizes are correct (but not the placement)
    >
    > Any suggestion ?
    > (I' using vers 5.4.6 under win2k)
    >
    > Regards
    > Maurizio
    >
    > go:-
    > new(D, dialog('example')),
    >
    > send(D, append, text_item('first')),
    > send(D, append, text_item('second'),right),
    > send(D, append, text_item('third'),next_row),
    > send(D, append, text_item('fourth')),
    >
    > send(D, append, button('ok', message(D, return, @nil))),
    > get(D, confirm, _),
    > send(D, destroy).

    Looks like a bug. The placement algorithm is unstable in
    this case and keeps enlarging the items. Placement is optimised
    iteratively until the result is stable or the max of 3 iterations
    is passed. I'll have a look, but not right now. There are a
    lot of variables to play with though and the following works:

            send(D, append, new(TI1, text_item('first'))),
            send(D, append, new(TI2, text_item('second')), right),
            send(D, append, text_item('third'), next_row),
            send(D, append, text_item('fourth')),
    (1) send(TI1, hor_stretch, 0),
    (2) send(TI2, alignment, left),

    The (1) marked line tells it not to stretch this field and
    the (2) not to create a second column. It is curious that
    just using one of them doesn't make it behave though.

            Cheers --- Jan


  • Next message: Jan Wielemaker: "Re: Help. invoke a swi-prolog program within an html page"