Tkinter text zoom in and out using buttons and using menus and using scale to trigger the font size

preview_player
Показать описание
00:37 adding buttons to use zoom in zoom out
05:08 Using menu to use zoom in zoom out
07:06 Adding scale to use zoom in zoom out

We can zoom in and zoom out the tex interred inside a text box by using buttons. Here we will link the font option to a list by declaring font family, font size and font style.

We will place two buttons, one for increasing and other for decreasing font size. Both the buttons will execute one common function by passing different parameters. By reading this parameter we will decide to increase or decrease the font size by using config option of the text area

We can use menu button to zoom in or zoom out the text, for this we will use the same functions

Scale can be used to increase or decrease the font size. Here one more function my_fun2() is used and inside this the value of the slider is collected and assigned to font size of the text widget by using the config option.

Download the source code from here.

#zoomInZoomOut #textZoom #fontsize #fontIncrease #fontdecrease #Tkinter #python #plus2net #zoomfontsize
Рекомендации по теме
Комментарии
Автор

U're making difference in my python skills....👌🏾

funnyclips
Автор

Hello, Could you please tell me how to zoom in or out a complete windows in Tkinter. Thanks in advance

IqbalHossain-eskd
Автор

Sir in this when we call the function my_fun in menubar we use lambda:my_fun, can you plz tell me why we use lambda: with the function and not only the function name

siblings_kitchen