Hello Harald,

I believe the code by AnonymousMonk from Jan 19 2025 19:07, with text "Adjusting cells height per row and, thus, simulating a table.." is the best approach if you want to use the packer geometry. Said that, I don't think that there's anything wrong in counting pixels; the code might be less elegant, that's true, but gives you all the flexibility when a geometry manager cannot do what you want. It comes down basically to knowing the height() of your first $label and first $input and just go all the way down from there. If you are concerned about the various font heights and how this will look like with other widgets with sizes not related to the default font (f ex an image that is always 100x100), you indeed can test that with Prima::Stress, and you can also use the .designScale() property and safely design your window layout the way you see it on your own screen - just find out what is your default widget font width and height and set these in the .designScale() property.

There's another thing though that I think can be tricky, multiline labels. Labels are flexible and can both adapt your text in a given size, and adapt their sizes after the text - you would most probably need .autoWidth and .wordWrap.

But I must admit that neither of these solution is as elegant as html's table, or Tk::grid for that matter. If there is interest, I might just add this feature to Prima, like I did back then with the placer and the packer.

Hope that makes sense


In reply to Re: Prima: How to get a "table" layout? by dk
in thread Prima: How to get a "table" layout? by haj

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.