Menu

#70 changing underline and overstrike line colors in text widget

open
18. [text] (18)
5
2003-11-13
2000-11-01
No

OriginalBugID: 4040 RFE
Version: 8.2.2
SubmitDate: '2000-01-19'
LastModified: '2000-04-16'
Severity: LOW
Status: UnAssn
Submitter: techsupp
ChangedBy: hobbs
OS: All
OSVersion: Solaris 5.6, Linux 6.0, AIX 4.2, Dec OSF V4.0D, NT 4
Machine: Sparc Ultre, PC Pentium III, IBM RS600, Dec Alpha

Name:
Xavier Fornari

CustomShell:
I added two options to a text tag, based on the same code as for the -foreground option. This quite small.

Comments:
tkTextPatch.tgz contains a README, a patch file and an example of use. The patch should be applied from the Tk source directory, because it will patch doc/text.n and generic/tkText* files.

DesiredBehavior:
the default behavior of -underline and -overstrike options of a text tag is to draw a line with the same color as the tagged text (or default color if there is no specific foreground). I defined two new options -underlinefg and -overstrikefg that define a specific color for the underline or the overstrike line. If these options are not set, or set to "{}", then the behavior is the same as the standard one, ie, the text color is used instead
I had already defined this enhancement for Tk3.6 and sent a patch (in 1994?) , but we did the move to Tk8.0 only last year.

Patch:
ftp://ftp-sop.inria.fr/meije/pub/tkTextPatch.tgz

PatchFiles:
tkText.h tkText.c tkTextTag.c tkTextDisp.c text.n

Discussion

  • Donal K. Fellows

    • milestone: 102501 --> 102483
     
  • Don Porter

    Don Porter - 2001-04-24
    • labels: 104346 -->
    • milestone: 102483 -->
     
  • Don Porter

    Don Porter - 2001-04-24
    • labels: --> 18. [text]
     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2002-01-16

    patch for text tags

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2002-01-16

    Logged In: YES
    user_id=72656

    the mentioned file is now attached.

     
  • Don Porter

    Don Porter - 2003-11-13
    • assigned_to: nobody --> vincentdarley
     
  • Vince Darley

    Vince Darley - 2003-11-13

    Logged In: YES
    user_id=32170

    Looks like a good idea, but needs a TIP. Perhaps the author
    can be persuaded to update the patch for CVS head and submit
    a TIP.

     
  • Vince Darley

    Vince Darley - 2003-11-13

    Logged In: YES
    user_id=32170

    Note: a subtlety here is that it seems as if the OS may draw
    the underline under some circumstances, and Tk under other
    circumstances. This means the patch would actually need to
    make sure the OS _didn't_ draw the underline for it to have
    control over colour.

    See:
    https://sourceforge.net/tracker/?func=detail&atid=112997&aid=436817&group_id=12997

    (bug #436817)

     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.