Re: Label layout


Again, thanks for the comments.  I'll keep working on it --- though,
as I've already warned you don't expect much from me until sometime
next year.

In message <>,Owen Taylor writes:
>> Using this last algorithm means that a column of filled labels
>> (in a vbox, say) will all pick different paragraph widths for themselves.
>> This may not be desirable behavior.
>The _requested_ width should be chosen by these types of heuristics.
>But you should then use whatever width is finally allocated. So a
>column of filled labels will all have the same width. You may
>run into problems though, since GTK only does a single pass - Raph's
>Gzw widgets do separate horizontal/vertical allocation passes to
>handle text wrapping correctly.

I initially was going to fill paragraphs to the allocated width,
but decided not to because:

  1. As you point out this screws up the vertical allocation.  Though
  I guess this would result in ugliness rather than disaster, since
  the requested and allocated heights should always be at least the
  final required height.

  2. The original gtklabel.c code (i.e. pre my patches, or the code
  in the current gtk+-0.99.0 snapshot) justifies text within the
  requested width, not the allocated width.

In light of these considerations, I'm inclined to continue to justify
to the requested width.  If/when GTK's allocation algorithm gets fixed
so that #1 (above) is no longer an issue, then this could be fixed.

Happy Holidays,

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