Short version: How do I get text centred vertically in a tablelist cell?
I'm using a home-brew tcl 9.0.3 with tablelist (strictly tablelist_tile) 7.8.
Long version:
I have a habit of including a history in my source code. This is a list
of 4*n entries, with each quadruple comprising the version number,
author's name, date and a description of the changes. I then include a
menu entry to display the history. (Pretentious, I know, but
occasionally useful.)
I've just re-written this code to use a tablelist with four columns
rather than a text widget with tabs to get things to line up.
Sometimes the description is quite long, and by default the tablelist
aligns things halfway down the cell, which hard to read. I'd like
everything to be at the top of the cells, so I've specified
-valign top
on all four columns.
Sadly, the lines are still centred vertically, see the image here -
Here's the configuration that I think is relevant:
% foreach col {0 1 2 3} {
puts stdout [format {%d - alignment: %s; wrap: %s; contents:
%s} $col [$tbl cellcget 1,$col -valign] [$tbl columncget $col -wrap]
[$tbl cellcget 1,$col -text]]
}
0 - alignment: top; wrap: 0; contents: 1.1
1 - alignment: top; wrap: 0; contents: Alan Grunwald
2 - alignment: top; wrap: 0; contents: 13-May-2016
3 - alignment: top; wrap: 1; contents: (Collapsed draft version 1.1 comments.) Add ability to paste in a bridgewebs scorecard.
What have I missed?
Alan
Short version: How do I get text centred vertically in a tablelist cell?
I'm using a home-brew tcl 9.0.3 with tablelist (strictly tablelist_tile) 7.8.
Long version:
I have a habit of including a history in my source code. This is a list
of 4*n entries, with each quadruple comprising the version number,
author's name, date and a description of the changes. I then include a
menu entry to display the history. (Pretentious, I know, but
occasionally useful.)
I've just re-written this code to use a tablelist with four columns
rather than a text widget with tabs to get things to line up.
Sometimes the description is quite long, and by default the tablelist
aligns things halfway down the cell, which hard to read. I'd like
everything to be at the top of the cells, so I've specified
-valign top
on all four columns.
Sadly, the lines are still centred vertically, see the image here -
Here's the configuration that I think is relevant:
% foreach col {0 1 2 3} {
puts stdout [format {%d - alignment: %s; wrap: %s; contents:
%s} $col [$tbl cellcget 1,$col -valign] [$tbl columncget $col -wrap]
[$tbl cellcget 1,$col -text]]
}
0 - alignment: top; wrap: 0; contents: 1.1
1 - alignment: top; wrap: 0; contents: Alan Grunwald
2 - alignment: top; wrap: 0; contents: 13-May-2016
3 - alignment: top; wrap: 1; contents: (Collapsed draft version 1.1 comments.) Add ability to paste in a bridgewebs scorecard.
What have I missed?
Alan
Am 19.12.25 um 19:43 schrieb Alan Grunwald:
Short version: How do I get text centred vertically in a tablelist cell?
I'm using a home-brew tcl 9.0.3 with tablelist (strictly
tablelist_tile) 7.8.
Long version:
I have a habit of including a history in my source code. This is a
list of 4*n entries, with each quadruple comprising the version
number, author's name, date and a description of the changes. I then
include a menu entry to display the history. (Pretentious, I know, but
occasionally useful.)
I've just re-written this code to use a tablelist with four columns
rather than a text widget with tabs to get things to line up.
Sometimes the description is quite long, and by default the tablelist
aligns things halfway down the cell, which hard to read. I'd like
everything to be at the top of the cells, so I've specified
-valign top
on all four columns.
Sadly, the lines are still centred vertically, see the image here -
Here's the configuration that I think is relevant:
% foreach col {0 1 2 3} {
puts stdout [format {%d - alignment: %s; wrap: %s;
contents: %s} $col [$tbl cellcget 1,$col -valign] [$tbl columncget
$col -wrap] [$tbl cellcget 1,$col -text]]
}
0 - alignment: top; wrap: 0; contents: 1.1
1 - alignment: top; wrap: 0; contents: Alan Grunwald
2 - alignment: top; wrap: 0; contents: 13-May-2016
3 - alignment: top; wrap: 1; contents: (Collapsed draft version
1.1 comments.) Add ability to paste in a bridgewebs scorecard.
What have I missed?
Alan
As specified in the documentation, the -valign option specifies the
vertical alignment of embedded images and windows only. Due to restrictions imposed by the underlying text widget there is no way to support this options for the texts too, sorry!
| Sysop: | DaiTengu |
|---|---|
| Location: | Appleton, WI |
| Users: | 1,096 |
| Nodes: | 10 (0 / 10) |
| Uptime: | 400:34:41 |
| Calls: | 14,036 |
| Calls today: | 2 |
| Files: | 187,082 |
| D/L today: |
2,887 files (1,738M bytes) |
| Messages: | 2,479,121 |