in reply to Re^2: Prima: How to get a "table" layout?
in thread Prima: How to get a "table" layout?

How interesting. This can be one of the problems with GUI's. On My machine, all lines look just fine even with 20 rows on my display. I am unable to reproduce your symptoms. This perhaps could have something to do with the font's that your machine is using? Is anybody else here able to reproduce Haj's symptom?

Added: I am using default fonts. Are you running my code verbatim as shown? This could be an issue if you are using UTF-8 or unicode. You could try explicitly configuring the font and font size for each label and entry widget. These widgets are designed with exactly this "label: Entry"side by side usage in mind. My lines line up to the exact pixel. There are other ways to do this. In Tk, there is TableMatrix which can produce a spreadsheet like appearance. I've used that with 2,000 rows.

I am using 64 bit Perl 5.24 on Win10.

  • Comment on Re^3: Prima: How to get a "table" layout?

Replies are listed 'Best First'.
Re^4: Prima: How to get a "table" layout?
by haj (Vicar) on Jan 19, 2025 at 22:41 UTC

    I am aware that it might work somewhere. I wrote:

    I would also prefer not to count pixels for the line height, which might differ for different platforms (or fonts).

    Here's how it looks with ~20 lines on my Ubuntu 24.01 LTS: https://haraldjoerg.github.io/i/tk_table.png

      WOW! That is indeed ugly! On Windows, the same thing looks great.

      One thought, is that TCL has a LabelEntry widget, more flexible than Tk's LabEntry. I was thinking that using a widget that combines the Label and the Entry might solve the alignment problem? I couldn't get the Tk LabEntry to do exactly what I wanted, but this can take experimentation.

      The TableMatrix I think would solve the issue and be multi-platform, but it would require a bit more work although, I think you can put an entry widget inside of one of the Matrix boxes.

      Overall, a nasty problem because Label: Entry would be a normal way one would want to use these widgets.