Tkinter text widget managing text wrapping by wrap option using checkbutton or menu click event

preview_player
Показать описание
01:50 adding function to toggle the option wrap
03:50 adding checkbutton to toggle the option wrap

We can use the wrap option of the Text widget to manage the data entry. First we will use one menu checkbutton to trigger one function and inside which we will use the config method to set the value of wrap option. For this first we will read the wrap option and using one if condition we will compare the value. If the value is word then we will set it to none and if it is none then we will set it to word.

Similarly we will add one Checkbutton and on click event of this checkbutton we will trigger the function. INside the function we will continue the same process to check the present status of wrap option and then we will set the value to word or none based on the current setting.

Full source code for both can be downloaded from here

#textwrap #tkitnerwrap #CheckbuttonWrap #TextwidgetWrap #dataWrapping #text
Рекомендации по теме
Комментарии
Автор

Fantastic sir to tech wrap
I am confused for wrap.

web_dev_with_ak
Автор

the way you explain the code mean that you have not copied it from one place
a now i can understand some code by looking and studing your videos thinks prof

abteyeb
Автор

Plz also help me to make zoom in and zoom out button for .txt file

siblings_kitchen
Автор

Without clik button when I write big text then automatically change wrap how to write code

krishnajagadeesh