In my application I create text widgets, fill them with text-content,
and eventually use ".text see ..." to make sure that a particular
part of the content is visible once the widget becomes visible.
E.g.: the text-widget contains 10 lines of context, and is setup
for a height of 8 lines (and a scrollbar), and I use "see" to make
sure that line 2 is initially visible. This may as well be a different number - in some cases I may need to have line 10 initially visible.
The part of code doing the "see" is agnostic of the text widget's
current visibility/realization.
Now the problem: If - by the time I use the "see" command - the widget
isn't yet visible (but it's requested width&height are already confed)
then internally it seems to believe a size of 1x1 pixels, and therefore
it sets the initial scrollposition to the second line, although second
line would be eventually perfectly visible even without scrolling.
Once the text widget is visible, "see" does a perfect job of determining
the need to scroll for the target, but it would be nice if it could
do the same job for not-yet-<Configure>d widgets, and in that case
based on the requested sizes, lacking actual sizes.
I can imagine some workarounds (e.g. postponing the "see" using "after
idle ...", or explicitly calculating the initial need for scroll, or explicitly re-implementing "see" in my own code, but none of them
seem nice to me.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 285 |
Nodes: | 16 (2 / 14) |
Uptime: | 21:52:48 |
Calls: | 6,448 |
Files: | 12,050 |
Messages: | 5,254,047 |