Many thanks, it worked like a charm.

Vasilis

________________________________________
From: Tkinter-discuss 
[tkinter-discuss-bounces+vasilis.vlachoudis=cern...@python.org] on behalf of 
Cam Farnell [ms...@bitflipper.ca]
Sent: Friday, October 26, 2018 17:38
To: tkinter-discuss@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@python.org
> https://mail.python.org/mailman/listinfo/tkinter-discuss
>
_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss@python.org
https://mail.python.org/mailman/listinfo/tkinter-discuss
_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss@python.org
https://mail.python.org/mailman/listinfo/tkinter-discuss

Reply via email to