TIP #443: MORE TAG CONFIGURATION OPTIONS FOR THE TEXT WIDGET ============================================================== Version: $Revision: 1.9 $ Author: François Vogel State: Final Type: Project Tcl-Version: 8.6.6 Vote: Done Created: Tuesday, 09 February 2016 URL: https://tip.tcl-lang.org443.html Post-History: ------------------------------------------------------------------------- ABSTRACT ========== Despite the *text* widget already has numerous configuration options, some users need more refinements and have requested new tag configuration options. This TIP proposes to add these options, when deemed relevant. RATIONALE =========== Several users have reported they miss different tag configuration options in the *text* widget, stating they cannot achieve the rendering they target. Such RFE include: * RFE 1759972 [], with Patch 3469780 [] * RFE 220889 [] * RFE 1754048 [] PROPOSED CHANGE ================= It is proposed to add the following tag configuration options to the Tk *text* widget: *-selectbackground* /color/: Specifies the background color to use when displaying selected items. It may have any of the forms accepted by *Tk_GetColor*. If /color/ has not been specified, or if it is specified as an empty string, then the color specified by the *-background* tag option is used. Note regarding the particular case of the "sel" tag: Currently, the "sel" tag *-background* tag option is mirrored with the *-selectbackground* text widget option. This makes sense. It does not make real sense to have *-selectbackground* applied to the "sel" tag (it is more intuitive to use *-background* for the "sel" tag). However, if the "sel" tag receives non-empty *-selectbackground*, then this tag option prevails on the *-background* tag option for mirroring, i.e. the *-selectbackground* tag option is mirrored with the *-selectbackground* widget option. *-selectforeground* /color/: Specifies the foreground color to use when displaying selected items. It may have any of the forms accepted by *Tk_GetColor*. If /color/ has not been specified, or if it is specified as an empty string, then the color specified by the *-foreground* tag option is used. Note regarding the particular case of the "sel" tag: same principle as above for *-selectbackground*. *-underlinefg* /color/: Specifies the color to use when displaying the underline. It may have any of the forms accepted by *Tk_GetColor*. If /color/ has not been specified, or if it is specified as an empty string, then the color specified by the *-foreground* tag option is used (if there is one, otherwise the the color specified by the *-foreground* widget option is used). *-overstrikefg* /color/: Specifies the color to use when displaying the overstrike. It may have any of the forms accepted by *Tk_GetColor*. If /color/ has not been specified, or if it is specified as an empty string, then the color specified by the *-foreground* tag option is used (if there is one, otherwise the color specified by the *-foreground* widget option is used). *-lmargincolor* /color/: /Color/ specifies the background color to use in regions that do not contain characters because they are indented by *-lmargin1* or *-lmargin2*. It may have any of the forms accepted by *Tk_GetColor*. If /color/ has not been specified, or if it is specified as an empty string, then the color specified by the *-background* widget option is used. *-rmargincolor* /color/: /Color/ specifies the background color to use in regions that do not contain characters because they are indented by *-rmargin*. It may have any of the forms accepted by *Tk_GetColor*. If /color/ has not been specified, or if it is specified as an empty string, then the color specified by the *-background* widget option is used. REJECTED ADDITIONAL TAG CONFIGURATION OPTIONS =============================================== RFE 1759972 [] requested stippling (*-selectbgstipple*, *-selectfgstipple*) for selected text. Also RFE 1754048 [] requested stippling in left and right margins of the text widget (*-lmargin1stipple*, *-lmargin2stipple*, *rmarginstipple*). Any new stippling options was rejected during the discussion about this TIP. Reasons were as follows: * "Stippling and anything related to Tk Bitmaps should be considered obsolete. Their use should be phased out, not expanded. (Bitmaps have very limited support in Tk, and stippling is virtually never used in modern user interfaces. In fact, AFAIK current graphics stacks -- cairo, Quartz, Direct3D, &c -- don't even support this operation." * "Stippling is something that is an artefact of a prior time, and it looks pretty bad now. These days, a way to specify an alpha value for the tag would be far more relevant, since then it would end up with a blend of the text foreground and background." REFERENCE IMPLEMENTATION ========================== A reference implementation is available in branch tip-443 of the fossil repository. COPYRIGHT =========== This document has been placed in the public domain. ------------------------------------------------------------------------- TIP AutoGenerator - written by Donal K. Fellows