Re: Text folding of text

Bryan Oakley <[email protected]>
Newsgroups gmane.comp.python.tkinter
Message-ID <CAKypQnww+b82SS7uTP=codhtvAZgPQSqoHRZoE3pgvEX-RV+Fw@mail.gmail.com>
Yes, it is possible, though you have to do a lot of the work yourself. You
can actually intercept the low level text insertions and deletions that
happen as a result of the built-in bindings, and allow or reject the
insertions based on whatever criteria you want.

You can, for example, check the tags surrounding the insertion point when
text is inserted. If you have a tag such as "readonly", you can prevent the
insertion from happening.

Here's a solution that illustrates the technique:
http://stackoverflow.com/a/11180132/7432


On Thu, Jan 22, 2015 at 10:24 AM, Vasilis Vlachoudis <
[email protected]> wrote:

>  Dear all,
>
> I want to create a text box with folding capabilities.
> To show/hide lines of text (probably using the elide function)
> but when I hide the text I want it to be replaced by one line
> +---- 10 lines folded ----
> that extends to the full width of the text widget
> and the editing is disabled on that line.
>
> Is it possible to disable the editing on specific lines/tags?
>
> Thanks in advance
> Vasilis
>
>
> _______________________________________________
> Tkinter-discuss mailing list
> [email protected]
> https://mail.python.org/mailman/listinfo/tkinter-discuss
>
>

_______________________________________________
Tkinter-discuss mailing list
[email protected]
https://mail.python.org/mailman/listinfo/tkinter-discuss
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.