Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

tktable text garbled when cell area insufficient to display entire text

173 views
Skip to first unread message

rob...@crosstab.com

unread,
Aug 15, 2019, 1:28:04 PM8/15/19
to
using tktable 2.11 with wish 8.6.9 on Mojave

given a simple table (table .t -cols 2 -rows 4 -variable var)

if I enter enough text that it doesn't fit, it will appear garbled, sometimes even part of the text showing up over a distant cell. Of course, it is fixed when I resize but I would like it to be cut off. (in fact I think that is what the -ellipsis is to do, but that doesn't seem to have an affect. Besides sometimes I need to have -wrap or -multiline, which don't work with -ellipsis)

Contrast this with the entry widget, which clearly displays partial text when the entire text does not fit
eg
entry .e -width 5
.e insert end "1234567890"
only the first 5 or so chars will be displayed, but clearly legible.
is there a way to get tktable to do that. In an older version that I used, it behaved this way.

thanks for any help!

Robert Karen

chris...@gmx.us

unread,
Aug 16, 2019, 1:16:11 AM8/16/19
to
On Thursday, August 15, 2019 at 12:28:04 PM UTC-5, rob...@crosstab.com wrote:
> using tktable 2.11 with wish 8.6.9 on Mojave
>
> given a simple table (table .t -cols 2 -rows 4 -variable var)
>
> if I enter enough text that it doesn't fit, it will appear garbled, sometimes even part of the text showing up over a distant cell.

This is a known issue when using Tktable under Cocoa-based Tk Aqua, and has been for several years now. See https://sourceforge.net/p/tktable/bugs/309/

So far the suggested workaround is to use -drawmode slow.

Christopher Chavez

rob...@crosstab.com

unread,
Aug 16, 2019, 11:09:03 AM8/16/19
to
On Friday, August 16, 2019 at 1:16:11 AM UTC-4, chris...@gmx.us wrote:
>
> This is a known issue when using Tktable under Cocoa-based Tk Aqua, and has been for several years now. See https://sourceforge.net/p/tktable/bugs/309/
>
> So far the suggested workaround is to use -drawmode slow.
>
> Christopher Chavez

Thanks. That is much better. But I see that -drawmode slow leaves the text a bit fuzzy even in cells where it's not clipped.

chris...@gmx.us

unread,
Apr 11, 2020, 3:58:35 AM4/11/20
to
I've since investigated the issue a bit more and believe it's caused by an issue in Tk Aqua which could be challenging to fix:
https://core.tcl-lang.org/tk/info/685ac30727
Tktable could work around it, but the project is dormant.


On 8/16/2019 10:09 AM, rob...@crosstab.com wrote:
> Thanks. That is much better. But I see that -drawmode slow leaves the text a bit fuzzy even in cells where it's not clipped.

If you still observe the fuzzy text, could you post screenshots of fuzzy vs not-fuzzy text somewhere or to the Tktable bug report? I'm curious what could be causing it, but haven't observed it myself. Do you happen to be using a retina display?

Christopher A. Chavez

chris...@gmx.us

unread,
Apr 13, 2020, 11:43:57 AM4/13/20
to
On 4/12/2020 9:44 AM, Robert Karen wrote:
> here are 2 images one with drawmode slow and and fuzzy text. teh other
> without.

Thank you for sharing those. Your MacBook Air indeed has a Retina display.

I have cropped the screenshots and posted my theory on what is causing the fuzzy text to the Tktable ticket:
https://sourceforge.net/p/tktable/bugs/309/#7b1c
as well as a new Tk ticket:
https://core.tcl-lang.org/tk/info/e2e9ce70b2

My theory is that because `-drawmode slow` causes the entire table to be drawn to a temporary buffer instead of directly to the screen, the operations for drawing text, etc. are drawing at non-Retina (1x) scale, and then when that buffer is finally drawn to the screen it is magnified 200% and antialiased, resulting in fuzzy text. (Operations that draw directly to the screen are Retina-aware and so do not need magnification and do not look fuzzy.)

I don't currently know whether Tk or Tktable are able to address the fuzzy text issue, and am not aware of a workaround.

Christopher A. Chavez

Christopher Chavez

unread,
Sep 11, 2020, 5:37:39 PM9/11/20
to
Update: Tk Aqua 8.6.11 will contain a solution for these issues, but taking advantage of it requires recompiling Tktable with a tiny change. See https://sourceforge.net/p/tktable/bugs/309/#22e7 for more info and a patchfile. Once this is done, -drawmode slow should no longer be used in order to avoid the fuzzy text on Retina displays.

Christopher A. Chavez
0 new messages