Skip Menu |

This queue is for tickets about the Tcl-pTk CPAN distribution.

Report information
The Basics
Id: 129543
Status: open
Priority: 0/
Queue: Tcl-pTk

People
Owner: Nobody in particular
Requestors: welleozean [...] googlemail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Strange rendering of text in Tcl::pTk::TableMatrix::Spreadsheet
Date: Sun, 12 May 2019 12:45:35 +0200
To: bug-Tcl-pTk [...] rt.cpan.org
From: welle ozean <welleozean [...] googlemail.com>
Hello, not sure if this is a Tk issue or a Tcl::pTk one, so I start posting it here. I use a Tcl::pTk::TableMatrix::Spreadsheet table with option -wrap=>1 to display text. Depending on the geometry of the table, the text get displayed in a quite weird way (sometimes it is 'doubled'). See screenshot below: [image: Screenshot 2019-05-12 at 12.23.35.png] To better understand the issue I made a short video: https://vimeo.com/335677031 Welle
Screenshot 2019-05-12 at 12.23.35.png
Subject: Re: [rt.cpan.org #129543] AutoReply: Strange rendering of text in Tcl::pTk::TableMatrix::Spreadsheet
Date: Sun, 12 May 2019 13:01:33 +0200
To: bug-Tcl-pTk [...] rt.cpan.org
From: welle ozean <welleozean [...] googlemail.com>
After some casual testing, I think that the option causing it is -drawmode . If set to anything but 'slow' or if not set at all, the issue does come up. The only thing that prevents it to come up, is to set this option to 'slow'. Still I do not know what is the cause of the problem, but at least it seems to be confined to this option. Am So., 12. Mai 2019 um 12:45 Uhr schrieb Bugs in Tcl-pTk via RT < bug-Tcl-pTk@rt.cpan.org>: Show quoted text
> > Greetings, > > This message has been automatically generated in response to the > creation of a trouble ticket regarding: > "Strange rendering of text in Tcl::pTk::TableMatrix::Spreadsheet", > a summary of which appears below. > > There is no need to reply to this message right now. Your ticket has been > assigned an ID of [rt.cpan.org #129543]. Your ticket is accessible > on the web at: > > https://rt.cpan.org/Ticket/Display.html?id=129543 > > Please include the string: > > [rt.cpan.org #129543] > > in the subject line of all future correspondence about this issue. To do > so, > you may reply to this message. > > Thank you, > bug-Tcl-pTk@rt.cpan.org > > ------------------------------------------------------------------------- > Hello, > > not sure if this is a Tk issue or a Tcl::pTk one, so I start posting it > here. > > I use a Tcl::pTk::TableMatrix::Spreadsheet table with option -wrap=>1 to > display text. Depending on the geometry of the table, the text get > displayed in a quite weird way (sometimes it is 'doubled'). See screenshot > below: > > [image: Screenshot 2019-05-12 at 12.23.35.png] > > To better understand the issue I made a short video: > https://vimeo.com/335677031 > > Welle >
I'm not too familiar with TableMatrix, but I think this might be a bug in either Tk or in TkTable.

I am using TkTable 2.10 from MacPorts. I can reproduce something similar to this fairly easily with the both the TableMatrix and pure-Tcl TkTable demos (see attached screenshot: left is TkTable, right is TableMatrix from Tcl::pTk).
Subject: Screen Shot 2019-05-12 at 6.06.37 AM.png
Screen Shot 2019-05-12 at 6.06.37 AM.png
Subject: Re: [rt.cpan.org #129543] Strange rendering of text in Tcl::pTk::TableMatrix::Spreadsheet
Date: Sun, 12 May 2019 13:18:38 +0200
To: bug-Tcl-pTk [...] rt.cpan.org
From: welle ozean <welleozean [...] googlemail.com>
After some testing, I think that the option causing the issue is -drawmode . If set to anything but 'slow' or if not set at all, the issue does come up. The only thing that prevents it to come up, is to set this option to 'slow'. Still I do not know what is the cause of the problem, but at least it seems to be confined to this option. Am So., 12. Mai 2019 um 13:09 Uhr schrieb Christopher Alexander Chavez via RT <bug-Tcl-pTk@rt.cpan.org>: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=129543 > > > I'm not too familiar with TableMatrix, but I think this might be a bug in > either Tk or in TkTable. > > I am using TkTable 2.10 from MacPorts. I can reproduce something similar to > this fairly easily with the both the TableMatrix and pure-Tcl TkTable demos > (see attached screenshot: left is TkTable, right is TableMatrix from > Tcl::pTk). > >
TkTable seems pretty dormant. Here's a 9-year-old TkTable ticket that I think describes this issue, along with the -drawmode slow workaround: https://sourceforge.net/p/tktable/bugs/309/. It sounds like this might be a bug in Tk Cocoa, so I wonder if a Tk bug ticket was also ever filed.
Subject: Re: [rt.cpan.org #129543] Strange rendering of text in Tcl::pTk::TableMatrix::Spreadsheet
Date: Sun, 12 May 2019 15:07:22 +0200
To: bug-Tcl-pTk [...] rt.cpan.org
From: welle ozean <welleozean [...] googlemail.com>
Thank you for pointing me to this thread (and for posting the bug there). Nice to see I came out with the same workaround. Yes ,TkTable seems to be very dormant. I just checked the latest ActiveState distribution. They ship a Tktable 2.11 (even if this version is not available in the Tktable repository). In any case the issue persists. Am So., 12. Mai 2019 um 13:23 Uhr schrieb Christopher Alexander Chavez via RT <bug-Tcl-pTk@rt.cpan.org>: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=129543 > > > TkTable seems pretty dormant. Here's a 9-year-old TkTable ticket that I > think > describes this issue, along with the -drawmode slow workaround: > https://sourceforge.net/p/tktable/bugs/309/. It sounds like this might be > a bug > in Tk Cocoa, so I wonder if a Tk bug ticket was also ever filed. > >
Subject: Re: [rt.cpan.org #129543] Strange rendering of text in Tcl::pTk::TableMatrix::Spreadsheet
Date: Sun, 12 May 2019 15:08:02 +0200
To: bug-Tcl-pTk [...] rt.cpan.org
From: welle ozean <welleozean [...] googlemail.com>
I guess this bug report can be closed, as it is definitely not a Tcl::pTk problem. Am So., 12. Mai 2019 um 15:07 Uhr schrieb welle ozean < welleozean@googlemail.com>: Show quoted text
> Thank you for pointing me to this thread (and for posting the bug there). > Nice to see I came out with the same workaround. Yes ,TkTable seems to be > very dormant. I just checked the latest ActiveState distribution. They ship > a Tktable 2.11 (even if this version is not available in the Tktable > repository). In any case the issue persists. > > Am So., 12. Mai 2019 um 13:23 Uhr schrieb Christopher Alexander Chavez via > RT <bug-Tcl-pTk@rt.cpan.org>: >
>> <URL: https://rt.cpan.org/Ticket/Display.html?id=129543 > >> >> TkTable seems pretty dormant. Here's a 9-year-old TkTable ticket that I >> think >> describes this issue, along with the -drawmode slow workaround: >> https://sourceforge.net/p/tktable/bugs/309/. It sounds like this might >> be a bug >> in Tk Cocoa, so I wonder if a Tk bug ticket was also ever filed. >> >>
On Sun May 12 08:08:26 2019, welleozean@googlemail.com wrote:
Show quoted text
> I guess this bug report can be closed, as it is definitely not a Tcl::pTk problem.

I appreciate the conscientiousness toward keeping the tickets organized; that's a good attitude to have. I personally wasn't yet sure what to do with tickets for upstream issues, which do not seem uncommon for Tcl::pTk. I'm aware many projects (especially those with much higher ticket volumes) try to close any old or "not our bug" tickets in order to better highlight which issues they can/should still address. Leaving these tickets open however might be useful to other Tcl::pTk users (checking the Resolved and Rejected tickets is something to keep in mind though). 
I don't have a strong preference though, and would be open to suggestions.

Some ideas I have include adding [upstream Tcl/Tk issue] (or [upstream TkTable issue] in this case) to the title of the ticket and making sure an issue has been reported upstream, and then waiting to mark the Tcl::pTk ticket as "patched" or "resolved" after the upstream ticket is closed or a release incorporating a fix is available.

(I really should get around to spending time improving documentation, like providing better hints on how to tell if an issue is in Tcl::pTk or in something else like Tcl/Tk.)
I determined this to be an issue in Tk Aqua: https://core.tcl-lang.org/tk/info/685ac3072790118c . However it's unclear if it is an issue that Tk can actually resolve or one that Tktable could workaround (were it not dormant).
I believe this issue was introduced by Tk Aqua 8.6.9; the issue reported on SourceForge 10 years ago is likely a separate one that Tk Aqua resolved at some point. Both issues just happened to have the same steps to reproduce and -drawmode slow workaround.

Tk Aqua 8.6.11 will contain a solution for the new issue (already present in the upstream development branch "core-8-6-branch"), but taking advantage of it requires recompiling Tktable with a tiny change (undefine NO_XSETCLIP in tkTable.c; I am attaching a more complete patch provided to me by Marc Culler, a Tk Aqua developer). Once this is done, -drawmode slow should no longer be used in order to avoid fuzzy text on Retina displays.

Subject: tktable.patch
diff -ru Tktable2.10/generic/tkTable.c newTktable2.10/generic/tkTable.c --- Tktable2.10/generic/tkTable.c 2008-11-14 17:43:35.000000000 -0600 +++ newTktable2.10/generic/tkTable.c 2020-08-29 10:44:15.000000000 -0500 @@ -1680,7 +1680,7 @@ * rectangles. Thus turn it off for all cases until clip rectangles * are known to be respected. [Bug 1805350] */ -#if 1 || defined(MAC_TCL) || defined(UNDER_CE) || (defined(WIN32) && defined(TCL_THREADS)) || defined(MAC_OSX_TK) +#if !defined(MAC_OSX_TK) #define NO_XSETCLIP #endif /* diff -ru Tktable2.10/generic/tkTable.h newTktable2.10/generic/tkTable.h --- Tktable2.10/generic/tkTable.h 2005-02-01 22:22:25.000000000 -0600 +++ newTktable2.10/generic/tkTable.h 2020-08-29 10:48:46.000000000 -0500 @@ -15,6 +15,13 @@ #ifndef _TKTABLE_H_ #define _TKTABLE_H_ +#ifdef MAC_OSX_TK + #ifndef MAC_OSX_TCL + #define MAC_OSX_TCL + #endif +#endif +#define panic Tcl_Panic + #include <string.h> #include <stdlib.h> #include <ctype.h>