[Tkinter-discuss] Text: immutable strings

Vasilis Vlachoudis Vasilis.Vlachoudis at cern.ch
Sun Oct 28 05:21:15 EDT 2018


Many thanks, it worked like a charm.

Vasilis

________________________________________
From: Tkinter-discuss [tkinter-discuss-bounces+vasilis.vlachoudis=cern.ch at python.org] on behalf of Cam Farnell [msa01 at bitflipper.ca]
Sent: Friday, October 26, 2018 17:38
To: tkinter-discuss at python.org
Subject: Re: [Tkinter-discuss] Text: immutable strings

Hi Vasilis,

I've done this successfully. Bind an event handler to the KeyPress event of the text. Check the tags and if they are inside immutable text and the key is something that would change the text the return 'break' which will stop the processing of the key.

Cheers

Cam Farnell

On 2018-10-26 12:12 p.m., Vasilis Vlachoudis wrote:
> Hi all,
>
> I have a Text() widget and I want to display some values tab formatted.
> The values should be prefixed  with a text-label which is immutable by the user
> something like
>
>    label: value            label: value
>
> the user should be able to edit the values but not the labels.
> I know that I can insert the label as a window create_window(Label())
> but for very big files it becomes extremely slow
>
> If I tag the labels, can I forbid the Text widget to disallow the text editing
> over this specific tag?
>
> Thanks in advance
> Vasilis
> _______________________________________________
> Tkinter-discuss mailing list
> Tkinter-discuss at python.org
> https://mail.python.org/mailman/listinfo/tkinter-discuss
>
_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss at python.org
https://mail.python.org/mailman/listinfo/tkinter-discuss


More information about the Tkinter-discuss mailing list