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

Revised Tk Text Widget

412 views
Skip to first unread message

rem...@googlemail.com

unread,
Feb 12, 2017, 6:59:19 AM2/12/17
to
See http://scidb.sourceforge.net/tk/revised-text-widget.html for a revised text widget implementation. The main features are:

- Performance improvements:
- long line problem is eliminated
- undo/redo is very fast
- faster display stuff.

- Undo/redo now is handling tags, embedded images, and embedded windows.

- Bindings to embedded images are supported.

- Many more features.

- Many bug fixes.

Christian Gollwitzer

unread,
Feb 12, 2017, 7:17:59 AM2/12/17
to
Am 12.02.17 um 12:59 schrieb rem...@googlemail.com:
> See http://scidb.sourceforge.net/tk/revised-text-widget.html for a
> revised text widget implementation. The main features are:
>
> - Performance improvements: - long line problem is eliminated -
> undo/redo is very fast - faster display stuff.


Wow! Is it 100% compatible with the original text widget? If so, have
you checked it against the tablelist widget?

BTW, there is also ScintillaTk, which offers yet another solution.

Christian

rem...@googlemail.com

unread,
Feb 12, 2017, 10:20:11 AM2/12/17
to
> Wow! Is it 100% compatible with the original text widget?

Yes, it is fully compatible, only very minor exceptions.

> If so, have you checked it against the tablelist widget?

Only a quick test. I do not expect problems because of the compatibility.

> BTW, there is also ScintillaTk, which offers yet another solution.

Gregor

Yes, ScintillaTk offers another solution, but the revised text widget implementation is a replacement for the standard widget.

Brad Lanam

unread,
Feb 12, 2017, 1:24:17 PM2/12/17
to
On Sunday, February 12, 2017 at 7:20:11 AM UTC-8, rem...@googlemail.com wrote:
> > Wow! Is it 100% compatible with the original text widget?
>
> Yes, it is fully compatible, only very minor exceptions.

The next step would be to make sure it passes all the text widget tests.
There are a lot of new tests in the core-8-6-branch in the fossil repository that need to be run also.

rem...@googlemail.com

unread,
Feb 12, 2017, 2:39:57 PM2/12/17
to
> The next step would be to make sure it passes all the text widget tests.
> There are a lot of new tests in the core-8-6-branch in the fossil repository that need to be run also.

It is already passing all the text widget tests including newer ones from repository, you will find the adjusted tests in the distributed package. I had to adjust some test cases, because the revised implementation is better optimizing, so some trace results of display line computation are different, and some adjustments were required because of bug-fixes. One exception: I've tested under Linux, so the special Windoze and Mac test cases are open, here volunteers are needed.

BTW, the revised version is up-to-date, it contains all the novelties of the repository, provided that the novelties are not erroneous, or clumsy.

Gerald W. Lester

unread,
Feb 12, 2017, 2:56:59 PM2/12/17
to
Why not roll this into the core branch as a replacement?

--
+------------------------------------------------------------------------+
| Gerald W. Lester |
|"The man who fights for his ideals is the man who is alive." - Cervantes|
+------------------------------------------------------------------------+

Brad Lanam

unread,
Feb 12, 2017, 3:01:23 PM2/12/17
to
It's easy to set up a VM under Linux to run windows -- it will cost you $60-$150 (US) to purchase a windows distribution though.
(I have 7 Windows VMs for testing purposes, including Win2K, I am missing Vista 32-bit, and I have Windows 10 on my desktop).

For the Mac, I can supply you an account for Tcl/Tk testing on a mac.
- I'm in america, I have the slowest possible internet connection.
ssh works fine. For graphics, VNC works, but is very slow.
- Sometimes I use my network for downloads/uploads. The network can
become unusable.
- Francois Vogel also is testing Tcl/Tk using my Mac. I don't know how
well the network will handle multiple users using VNC.

This would be for Tcl/Tk testing only. If you want to test Scid, that would
be chargeable, though using Scid to test the text widget is valid.

Brad Lanam

unread,
Feb 12, 2017, 3:04:10 PM2/12/17
to
On Sunday, February 12, 2017 at 11:56:59 AM UTC-8, Gerald W. Lester wrote:
> On 2/12/17 1:39 PM, xyzzy wrote:
> >> The next step would be to make sure it passes all the text widget tests.
> >> There are a lot of new tests in the core-8-6-branch in the fossil repository that need to be run also.
> >
> > It is already passing all the text widget tests including newer ones from repository, you will find the
> > adjusted tests in the distributed package. I had to adjust some test cases, because the revised
> >implementation is better optimizing, so some trace results of display line
> computation are different,
> >and some adjustments were required because of bug-fixes. One exception: I've
> tested under Linux, so the
> >special Windoze and Mac test cases are open, here volunteers are needed.
> >
> > BTW, the revised version is up-to-date, it contains all the novelties of the repository, provided that
> >the novelties are not erroneous, or clumsy.
> >
>
> Why not roll this into the core branch as a replacement?


That's what I'm thinking.
The new functionality and enhancements will need a TIP.

Christian Gollwitzer

unread,
Feb 12, 2017, 3:19:01 PM2/12/17
to
Am 12.02.17 um 21:01 schrieb Brad Lanam:
> On Sunday, February 12, 2017 at 11:39:57 AM UTC-8,
>> One exception: I've tested
>> under Linux, so the special Windoze and Mac test cases are open,
>> here volunteers are needed.
>>
>> BTW, the revised version is up-to-date, it contains all the
>> novelties of the repository, provided that the novelties are not
>> erroneous, or clumsy.
>
> It's easy to set up a VM under Linux to run windows -- it will cost
> you $60-$150 (US) to purchase a windows distribution though.

You can get a Windows license for free, if it is for testing. Download
from
https://www.microsoft.com/en-us/evalcenter/evaluate-windows-10-enterprise?OCID=WIP_r_Win10_Body_Ent_Eval

You can answer that you want to test compatibility of your software with
Windows as the reason, and then you only need a Microsoft account (which
is a free registration). IMHO running this test suite is covered under
this license. However, it dies after 90 days, so installing the compiler
etc. should be kept at the minimum work.

Christian

Rich

unread,
Feb 12, 2017, 4:34:45 PM2/12/17
to
Brad Lanam <brad....@gmail.com> wrote:
> It's easy to set up a VM under Linux to run windows -- it will cost
> you $60-$150 (US) to purchase a windows distribution though.

If you are willing to put up with an every 90-days expiration period,
you don't need to pay anything to legally install a windows test VM:

https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/

rem...@googlemail.com

unread,
Feb 13, 2017, 5:33:09 AM2/13/17
to
> Why not roll this into the core branch as a replacement?

1. I don't know whether I have the permissions for a push.

2. But I won't do a push, due to my experience the Tk team is a bit strange. I've announced this revised version on the TCL developer mailing list, and if the Tk team likes to overtake this implementation, then they can do the push. The web pages provides the full package for a push.

rem...@googlemail.com

unread,
Feb 13, 2017, 5:47:13 AM2/13/17
to
> It's easy to set up a VM under Linux to run windows -- it will cost you $60-$150 (US) to purchase a windows distribution though.

Currently I have no income, so this is not possible for me.

> For the Mac, I can supply you an account for Tcl/Tk testing on a mac.

Many thanks for you offer, possibly I will use this. But at first I will wait for the tests results of Steve (Scid vs PC), with a bit luck it is already passing all relevant tests. And I have to prepare my system: 1) installation of VNC 2) this requires an update of the Linux system, I have an old unsupported version 3) this requires that I clean my disk, the disk is full. So I need some time until I can do the tests. How can I contact you?

> The new functionality and enhancements will need a TIP.

I don't need a TIP, my web page is much better. If the Tk team need's a TIP, they will do it, provided that the Tk team likes to overtake this revised version. I'm not sure about this, due to my impression this team is constantly ignoring petitions and suggestions. I need the revised version in my project Scidb, the original version is useless, it has some very annoying problems.

rem...@googlemail.com

unread,
Feb 13, 2017, 5:54:38 AM2/13/17
to
> You can get a Windows license for free, if it is for testing...
>
> You can answer that you want to test compatibility of your software with...

Many thanks for your suggestions. I have Windows 7 installed, so this is not the problem. Fact is that I don't like to work with Windoze, it's so disgraceful, compared to Linux. In the near past we've detected a bug with the Windoze version (Steve and I), and we couldn't find any working debugger for our cross-compiled executable, this was very frustrating. Soon we will try to test under Windoze with latest version, with a bit luck all the relevant test cases will pass, hopefully.

Brad Lanam

unread,
Feb 13, 2017, 6:06:25 AM2/13/17
to
On Monday, February 13, 2017 at 2:47:13 AM UTC-8, rem...@googlemail.com wrote:
> > It's easy to set up a VM under Linux to run windows -- it will cost you $60-$150 (US) to purchase a windows distribution though.
>
> Currently I have no income, so this is not possible for me.

Understood. I have no income either.

> > For the Mac, I can supply you an account for Tcl/Tk testing on a mac.
>
> Many thanks for you offer, possibly I will use this. But at first I will wait for the tests results of Steve (Scid vs PC), with a bit luck it is already passing all relevant tests. And I have to prepare my system: 1) installation of VNC 2) this requires an update of the Linux system, I have an old unsupported version 3) this requires that I clean my disk, the disk is full. So I need some time until I can do the tests. How can I contact you?

brad.lanam.comp @ gmail.com

And for the other people reading this, yes you may apply for a Tcl/Tk testing account for the purposes of helping Tcl/Tk get better on the mac. This is not my primary use machine, I only use it for testing my software. The caveats in the prior message in this thread apply.

Harald Oehlmann

unread,
Feb 13, 2017, 6:32:55 AM2/13/17
to
Am 13.02.2017 um 11:33 schrieb rem...@googlemail.com:
> 2. But I won't do a push, due to my experience the Tk team is a bit strange.

That is sad, as each developer (like you) is valuable.
It is best to get Tk fossil commit rights and present your changes in a
branch.

I can only say that Francois is caring very well since around one year
and the text widget is one of his points of interest.

I hope he will react on your message on the core list.

Thank you for all your work,
Harald

rem...@googlemail.com

unread,
Feb 13, 2017, 8:06:11 AM2/13/17
to
Many thanks for your address. I know that the revised version is especially important for the Mac, because here are the performance problems more severe, because of the context drawing (sub-pixel accuracy). Moreover the revised version is fixing a few bugs with context drawing.

Harald Oehlmann

unread,
Feb 13, 2017, 8:10:22 AM2/13/17
to
Am 13.02.2017 um 14:06 schrieb rem...@googlemail.com:
> Many thanks for your address. I know that the revised version is especially important for the Mac, because here are the performance problems more severe, because of the context drawing (sub-pixel accuracy). Moreover the revised version is fixing a few bugs with context drawing.
>

On the MAC, Kevin Walzer is caring with passion the last years.
So he might comment too.

Also Csaba may check compatibility, the author of tablelist. He reads
this list.

Nevertheless, the core list is the better place to address this
important feature.

Thank you,
Harald

rem...@googlemail.com

unread,
Feb 13, 2017, 8:12:55 AM2/13/17
to
> It is best to get Tk fossil commit rights and present your changes in a
> branch.

I won't do this, I'm not a Tk developer. And I think that the web page is a very good representation.

> I can only say that Francois is caring very well since around one year
> and the text widget is one of his points of interest.
>
> I hope he will react on your message on the core list.

I've already mentioned that I have bad experiences with the Tk team. But so far as I remember I never had contact with Francois. Till now no responses, but the report is quite huge, so this may take some time.

rem...@googlemail.com

unread,
Feb 13, 2017, 8:22:50 AM2/13/17
to
> Nevertheless, the core list is the better place to address this
> important feature.

I posted that I've announced this revised version on the TCL developer mailing list, in this case I meant the core list. But I think that this forum is the better place, see http://scidb.sourceforge.net/tk/delete-index-range.html, last paragraph.

Harald Oehlmann

unread,
Feb 13, 2017, 9:29:34 AM2/13/17
to
I am sorry for your experience,
Harald

Don Porter

unread,
Feb 13, 2017, 11:50:03 AM2/13/17
to
On 02/12/2017 01:24 PM, Brad Lanam wrote:
> The next step would be to make sure it passes all the text widget tests.

That seems like good advice, but the fact is that the existing text
widget doesn't pass all the tests. Don't make 100% compliance a
blocker to progress on this.

--
| Don Porter Applied and Computational Mathematics Division |
| donald...@nist.gov Information Technology Laboratory |
| http://math.nist.gov/~DPorter/ NIST |
|______________________________________________________________________|

fsvog...@free.fr

unread,
Feb 13, 2017, 12:33:36 PM2/13/17
to
I'm currently afk on holidays. Will post later, people please stop pinging me on this group and by private email.

Harald Oehlmann

unread,
Feb 13, 2017, 12:38:05 PM2/13/17
to
Am 13.02.2017 um 18:33 schrieb fsvog...@free.fr:
> I'm currently afk on holidays. Will post later, people please stop pinging me on this group and by private email.
Sorry, enjoy you holidays,
Harald

Christian Gollwitzer

unread,
Feb 13, 2017, 1:49:33 PM2/13/17
to
Am 13.02.17 um 14:22 schrieb rem...@googlemail.com:
Dear Gregor,

I am very sorry to hear your experience. I will try to explain a
possible reason. It happened to me, too, that a bug report (plus first
try to fix it) was ignored for several years, until recently when it
came up again. After reading a while on the core list and also in the
discussion forum (IRC + Jabber), I could understand the reason behind
this sluggishnes. It is not that the "Tk team" did not like my reports,
or ignore it, but simply that the "Tk team" was barely existent. Tcl is
not the most popular programming language, and the TCT is seriously
underpowered. So the most probably answer is that nobody was there to
take care of it.

I am sure that your work this time will be looked at more seriously. For
one thing, it solves some long-standing issues, for another there has
been more activity / people involved in Tk recently.

Still, I'm sure, if you have extensive experience with the source of Tk,
the TCT would welcome you as a committer to the mainline repo. There is
not many people who really understand the Tk sources.

Christian

rem...@googlemail.com

unread,
Feb 14, 2017, 3:22:08 PM2/14/17
to
> I am sure that your work this time will be looked at more seriously. For
> one thing, it solves some long-standing issues, for another there has
> been more activity / people involved in Tk recently.
>
> Still, I'm sure, if you have extensive experience with the source of Tk,
> the TCT would welcome you as a committer to the mainline repo. There is
> not many people who really understand the Tk sources.

In the meanwhile the "Tk team" has shown interest, but Francois Vogel is still in holidays, this delays a final decision.

pooryorick

unread,
Feb 20, 2017, 5:08:15 AM2/20/17
to
As Christian explained, the "Tk Team" only fails to reply because the number of hands is so few. Teams around here are very much self-selecting. You can make yourself part of the team simply by getting commit permissions (easy) and committing your changes to a branch. Once you do that, the changes are much closer to getting included on the trunk. You'll also find that going forward, it will be easier to maintain your modifications if they are on a branch in the repository.

--
Yorick

mse...@gmail.com

unread,
Feb 20, 2017, 8:15:17 AM2/20/17
to
On Sunday, 12 February 2017 12:59:19 UTC+1, rem...@googlemail.com wrote:
> See http://scidb.sourceforge.net/tk/revised-text-widget.html for a revised text widget implementation. The main features are:
>
> - Performance improvements:
> - long line problem is eliminated
> - undo/redo is very fast
> - faster display stuff.
>
> - Undo/redo now is handling tags, embedded images, and embedded windows.
>
> - Bindings to embedded images are supported.
>
> - Many more features.
>
> - Many bug fixes.

This looks really good, I hope that this passes as a full replacement to the TK text widget.

I see you added a -showendofline option and associated color, is there a similar -showtabs to show a symbol where there are tab characters, the mix of tabs ans spaces in the text widget is not at all visible.

Martyn

rem...@googlemail.com

unread,
Feb 21, 2017, 2:06:32 PM2/21/17
to
> I see you added a -showendofline option and associated color, is there a similar -showtabs to show a symbol where there are tab characters, the mix of tabs ans spaces in the text widget is not at all visible.

For the end of line symbol it's useful that the symbol and the color can be set, there is no other way. But for tabs an extension is not needed.

1. Showing tabs with a different symbol:
---------------------------------------------------------------
.t insert end [string map {\t \u2b7e} $text]
---------------------------------------------------------------
This maps any tab to Unicode point "HORIZONTAL TAB KEY".

2. Emphasizing tabs:
---------------------------------------------------------------
.t tag configure tab -background yellow
set n1 0
while {[set n2 [string first \t $text $n1]] >= 0} {
.t insert end [string range $text $n1 [expr {$n2 - 1}]]
.t insert end \t tab
set n1 [expr {$n2 + 1}]
}
.t insert end [string range $text $n1 end]
---------------------------------------------------------------
Any tab will be displayed with a yellow background.

rem...@googlemail.com

unread,
Feb 21, 2017, 2:11:33 PM2/21/17
to
> I see you added a -showendofline option and associated color, is there a similar -showtabs to show a symbol where there are tab characters, the mix of tabs ans spaces in the text widget is not at all visible.

For the end of line symbol it's quite useful that the symbol and the color can be set via options, there is no alternative way. But for tabs the thing is different:

1. Displaying tabs with a different symbol:
-----------------------------------------------------
.t insert end [string map {\t \u2b7e} $text]
-----------------------------------------------------
Shows any tab with Unicode point "HORIZONTAL TAB KEY".

2. Highlighting tabs:

rem...@googlemail.com

unread,
Feb 21, 2017, 2:14:37 PM2/21/17
to
Some news:
The revised text widget is committed to a branch in fossil repository of Tk library (thanks to Francois). Probably it may be shipped with version 8.7.

sled...@gmail.com

unread,
Feb 21, 2017, 6:43:46 PM2/21/17
to
On Sunday, February 12, 2017 at 6:59:19 AM UTC-5, rem...@googlemail.com wrote:
> See http://scidb.sourceforge.net/tk/revised-text-widget.html for a revised text widget implementation. The main features are:
>
> - Performance improvements:
> - long line problem is eliminated
> - undo/redo is very fast
> - faster display stuff.
>
> - Undo/redo now is handling tags, embedded images, and embedded windows.
>
> - Bindings to embedded images are supported.
>
> - Many more features.
>
> - Many bug fixes.

Is there a 'package' available that can be used with 'package require'. I have no ability or real skill to perform a compilation and then include it in tcl.

Please advise.

mse...@gmail.com

unread,
Feb 22, 2017, 3:18:30 AM2/22/17
to
Yes that could be used, but tabs are variable sized characters used to align text.

Your string map displays the tabs as single characters, which looks wrong.
see https://dl.dropboxusercontent.com/u/21149644/Photos/unicode.png

I was thinking more of what word does with invisible characters, the space could easily be changed with a string map and tags similar to yours but the EOL and tabs characters are more difficult or impossible.

I currently have code using -bgstipple but handling font changes is near impossible
see https://dl.dropboxusercontent.com/u/21149644/Photos/bgstipple.png

Martyn

Rich

unread,
Feb 22, 2017, 6:36:49 AM2/22/17
to
Did you test the #2 code sample?

Here is a simplified version:

text .t
pack .t
.t tag configure atab -background yellow
.t insert end a "" \t atab b ""

Run that in wish and you'll get letters a and b separated by a "tab"
where the tab has a yellow background.

Same can be done with end of lines (add to the above):

.t tag configure eol -background blue
.t insert end \n eol

And you'll have blue from just to the right of the "b" to the end of
the text widget window.

Tabs and end of lines are just characters, and they can have text
"tags" applied as well as the rest of the characters. And for those
text tag attributes that apply to a tab or end of line (i.e.,
foreground does not, as neither draws anything in the foreground) they
apply equally to tabs and end of line characters.

Now, maybe applying a background color is not what you are looking for,
but it is also not impossible to apply some highlight to tabs and ends
of lines.

rem...@googlemail.com

unread,
Feb 22, 2017, 7:29:02 AM2/22/17
to
> Your string map displays the tabs as single characters, which looks wrong.

In this case I had the vi editor in mind, here tabs will be replaced by "^I".

> I was thinking more of what word does with invisible characters, the space could easily be changed with a string map and tags similar to yours but the EOL and tabs characters are more difficult or impossible.
>
> I currently have code using -bgstipple but handling font changes is near impossible

Now I see what you mean. You have a very special solution, but a general solution for this is quite elaborated (and not easy). If you send a proposal for this feature to the Tcl project probably someone will implement this. Currently such a feature is out of scope, I'm sorry. The main goal at this time is to achieve a stable version: compiling on all platforms (a crux), and fixing all open bugs.

mse...@gmail.com

unread,
Feb 22, 2017, 8:00:16 AM2/22/17
to
I know all about the tab tags, in my second screen shot you can see the "-bgstipple" tag option and the "-background gray" option.

I was looking more for a Word or TkTextPlus (http://wiki.tcl.tk/17689) style
http://tktextplus.sourceforge.net/demo.png

Martyn

mse...@gmail.com

unread,
Feb 22, 2017, 8:01:17 AM2/22/17
to
Ok, it was just on the off chance, I will wait to try out the official version when it arrives.

Thanks again

Martyn

Rolf Ade

unread,
Feb 23, 2017, 7:28:47 AM2/23/17
to
Building on linux and running the test suite give seg fault, at some
point. More details at http://core.tcl.tk/tk/info/3a56576157559e6a
0 new messages