I'm prototyping an app that will display a file in a Text widget and allow you to apply filters to the text that will make the matching lines change attributes (color, bold, etc). One of the things that I would like the app to do is be able to make the lines disappear altogether, but easily be able to put them back if the filter is removed.

I get the attribute changing fairly cheaply by using tags and there is a -hidden flag that can be applied to tags, but from reading the source it seems as though hidden just means hidden from searches of the text, not hidden from the display. I've also tried finding a font that wouldn't display, but the only thing that I've found in X is nil2 which still leaves a 2 pixel high version of the line visible.

I have to admit that I'm lazy and am not too interested in putting the text into a canvas to accomplish this, but I would do that as a last resort.

Are there any ideas lurking these hallowed halls to help me continue the path of laziness?


In reply to Tk: Make lines disappear in a Text widget? by bschmer

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.