Ответ:1:import tkinter as tk
def change_window_size():
window.geometry("650x560")
window.config(bg='green')
button.config(bg='blue')
window = tk.Tk()
window.title("Вікно№1")
window.geometry("400x300")
button = tk.Button(text="Розфарбуй", command=change_window_size)
button.place(x=100, y=90)
window.mainloop()
2:import tkinter as tk
def change_color_and_text():
root.config(bg="purple")
button.config(bg="yellow")
message_window = tk.Toplevel(root)
message_label = tk.Label(message_window, text="Завдання виконано!", bg="purple", fg="white")
message_label.pack()
root = tk.Tk()
root.title("Вікно №2")
root.geometry("500x800")
button = tk.Button(root, text="Ок", bg="purple", command=change_color_and_text)
button.place(x=200, y=390)
root.mainloop()
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Verified answer
Ответ:
1:
import tkinter as tk
def change_window_size():
window.geometry("650x560")
window.config(bg='green')
button.config(bg='blue')
window = tk.Tk()
window.title("Вікно№1")
window.geometry("400x300")
button = tk.Button(text="Розфарбуй", command=change_window_size)
button.place(x=100, y=90)
window.mainloop()
2:
import tkinter as tk
def change_color_and_text():
root.config(bg="purple")
button.config(bg="yellow")
message_window = tk.Toplevel(root)
message_label = tk.Label(message_window, text="Завдання виконано!", bg="purple", fg="white")
message_label.pack()
root = tk.Tk()
root.title("Вікно №2")
root.geometry("500x800")
button = tk.Button(root, text="Ок", bg="purple", command=change_color_and_text)
button.place(x=200, y=390)
root.mainloop()