How To Dynamically Resize Button Text - Python Tkinter GUI Tutorial #146

preview_player
Показать описание
In this video I'll show you how to dynamically resize your button text when you resize your app with Tkinter and Python.

In the last video I showed you how to resize buttons automatically whenever a user changes the size of your app manually. In this video I'll show you how to do the same thing with your text size.

We'll do this by binding the root window Configure to a function that grabs the width and height of the app and uses those measurements to resize the text size of our button.
Рекомендации по теме
Комментарии
Автор

▶️ Watch Entire Tkinter Playlist ✅ Subscribe To My YouTube Channel:
▶️ See More At: ✅ Join My Facebook Group:
▶️ Get The Code

Codemycom
Автор

can you make app in django for login and register and how we can play with data in database?plz

AR-mkks
Автор

Is ther is any method like the media query in the web to resize the grid

ramehharmouch
Автор

Hi, pls do 3d graphics or zoom in/zoom out in canvas

YesItsRobin
Автор

Hello
Can you please show to wrap text inside Treeview .

sameerverma
Автор

Alternate title: make tkinter windows responsive

plusk
Автор

how to set a default size for minimizing? for example when the size(width or height) is less then 30 the size freeze at this level and we can't minimize.

ramehharmouch
Автор

Hey John, are you planning to provide ttk tutorial ? If not could you please plan to do it ? I mean using labels or entries or buttons of ttk. These stuff are kind of advance and difficult.

sakargiri
Автор

Something’s going wrong when I do this. My button is repeatedly getting big and small second by second.
Here is my code:

from tkinter import *
root = Tk()
btn = Button(root, text='Hi!')
btn.grid(row=0, column=0)
def resize(s):
size = s.width / 10
btn.config(font=('Helvetica', int(size)))
root.bind('<Configure>', resize)
root.mainloop()

Do I need to add anything else for this code?

sridharsivaraju
Автор

Hi! Could you show how to use a photo as a background (instead of a background colour)? Thanks:)

lukasrimkus
Автор

Sir How to disable the Maximize button of the tkinter window, please tell in your next video

akankshaubale
Автор

can someone please give the source code of this video

dr.mousumiboral
Автор

hey why don't you make a playlist with pygame along with tkinter its also a famous module to work on
Although you have some videos touching little bit of pygame .Though its a request the choice is

tuhinbhowmick
join shbcf.ru