[Lazarus] Displaying Tree Data from a Shell/Terminal command in a TListView [Linux Debian]
Aruna Hewapathirane
aruna.hewapathirane at gmail.com
Sun Nov 27 02:24:09 CET 2022
Hello Everyone,
I am running Linux Debian and putting together a utility that displays my
system information.
I am trying to display data from a disk file in a TListView box and this
part works.
The data I am trying to display is the output from the lsblk command, I
redirect the shell output to a disk file as shown below.
lsblk > lsblk.txt ( in my case lsblk.ajh )
My problem is when the data from this file is displayed in the TListView
there is a space/padding/margin between each displayed item which under
normal circumstances would have been fine.
But in this case, the output of the lsblk command has a tree on the very
left and this is not contiguous which breaks the tree lines so I would
like the displayed line/item to be sharing a common border so thereby
touching and making the tree lines smooth and contiguous.
As it is for my needs it is fine but if someday I decide to share the code
then this has to be resolved. I realize a TListView may not be the correct
or best component for this but I thought if there is a way to do this in a
TListView why not?
The displayed item height I am unable to change the through the object
inspector or through code.
Here is a screenshot <https://pasteboard.co/K7wTjTNR08bf.png> which should
be self-explanatory once you view the screenshot. The bottom left is a
shell/terminal and the output is rendered the way I expected. The form on
the top right you will notice has the tree lines separated by a
space/padding/margin. Please look at the 'tree' lines then you will
understand what my problem is.
After asking for help on the Lazarus forum I twiddled with the font size
and then it displayed the tree lines perfectly but I would like to know if
there is a way to do this using a TListView without having to be stuck with
a Monospace font and a specific font size? The forum question history is
here.
<https://forum.lazarus.freepascal.org/index.php/topic,61352.msg461356.html#msg461356>
Thank you for reading all this and I look forward to any advice + guidance.
Aruna
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20221126/a973742a/attachment.htm>
More information about the lazarus
mailing list