Tk Library Source Code

View Ticket
Login
Ticket UUID: 4e8fb9d55e39cad03c7f3cc6bba941fc54e941f1
Title: Update ctext
Type: Patch Version: 3.3
Submitter: anonymous Created on: 2019-05-30 22:29:51
Subsystem: tklib :: ctext Assigned To: nobody
Priority: 5 Medium Severity: Minor
Status: Open Last Modified: 2019-05-30 22:29:51
Resolution: None Closed By: nobody
    Closed on:
Description: (text/html)
<p>Hello everybody,</p>

<p>I use an updated ctext version for a Perl/Tcl::Tk application. Perhaps this is generally interesting for the Tcl community, too? </p>

<p>The new features are:</p>

<p>1)</p> 
<p>You can pass an array with option-values-pairs to all addHighlightClasses*. With this you can specifically set the tag configuration of a Highlight class. Especially it is possible to adjust not only the color of the tags/highlight classes, but also the font weight:</p>

<p>e.g.: <code>::ctextAdvanced::addHighlightClassForRegexp path keywords {-foreground #cb319b -font "Helvetica 10 bold"} pattern</code></p>

<p>2)</p>
<p>Unfortunately using a bold weight or the lika crashes the linemap numbering. So I had to implement the linemap anew. The main inspiration came from the line number example of Bryan Oakley (see <a href=https://wiki.tcl-lang.org/page/line+numbers+in+text+widget)>here</a></p>

<p>3)</p>
<p>Last but not least I added an additional option -linemap_font_select. With this you can change the font of the linemap if a number is pressed (so that you can display the number for example with bold weight if it is pressed)</p>

<p>4)</p>
<p>Perhaps a general option -linemap_font would be a good idea, too, so that the linemap and the text widget could have different fonts. But at the moment I have not implemented this...</p>


<p>I don't know whether my patches could be an idea for an update of ctext. Because I am no Tcl/Tk expert, it would be great, if somebody more experienced could check the proposed update. I think the changes would be very important improvements and would make ctext to a yet powerful tool.</p>
<p>The updated ctext version can be seen at <a href=https://github.com/MaxPerl/ctextAdvanced>github</a> (Temporary I name the enhanced version ctextAdvanced, but to update ctext one has only to replace ctextAdvanced with ctext (see also the ctext.tcl.patch file))</p>

<p>Best wishes,</p>
<p>Max</p>