Ответ:
import tkinter as tk
def on_click(event):
label.config(bg='brown', text='Мой проект')
def on_move(event):
width = label.winfo_width() + 3
height = label.winfo_height() + 3
label.config(width=width, height=height)
root = tk.Tk()
root.title('Проект')
root.geometry('300x100')
label = tk.Label(root, text='Нажми на меня!', font=('Arial', 16))
label.pack(pady=20)
label.bind('<Button-1>', on_click)
label.bind('<Motion>', on_move)
root.mainloop()
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Verified answer
Ответ:
import tkinter as tk
def on_click(event):
label.config(bg='brown', text='Мой проект')
def on_move(event):
width = label.winfo_width() + 3
height = label.winfo_height() + 3
label.config(width=width, height=height)
root = tk.Tk()
root.title('Проект')
root.geometry('300x100')
label = tk.Label(root, text='Нажми на меня!', font=('Arial', 16))
label.pack(pady=20)
label.bind('<Button-1>', on_click)
label.bind('<Motion>', on_move)
root.mainloop()