From 4d41b160a3cf91af00791b1929c9ff72a4c87668 Mon Sep 17 00:00:00 2001 From: kromskii2 <146603192+kromskii2@users.noreply.github.com> Date: Mon, 25 Mar 2024 20:04:14 +0700 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=BA=D0=BD=D0=BE=D0=BF=D0=BA=D0=B0=20=D1=8E?= =?UTF-8?q?=D1=82=D1=83=D0=B1=20=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=B0=20?= =?UTF-8?q?=D1=81=D0=BD=D0=B8=D0=B7=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Menu.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Menu.py b/Menu.py index b122eff..5a1a811 100644 --- a/Menu.py +++ b/Menu.py @@ -1,5 +1,5 @@ import tkinter as tk - +import webbrowser class RoundedMenuApp: def __init__(self, width, height, corner_radius): @@ -15,6 +15,7 @@ class RoundedMenuApp: self.canvas.pack() self.draw_rounded_corners() + self.create_youtube_button() # Создание кнопки YouTube def draw_rounded_corners(self): x0, y0 = 0, 0 @@ -29,6 +30,13 @@ class RoundedMenuApp: self.canvas.create_arc(x1 - radius * 2, y1 - radius * 2, x1, y1, start=270, extent=90, fill="white", outline="white") + def create_youtube_button(self): + youtube_button = tk.Button(self.root, text="YouTube", command=self.open_youtube) + youtube_button.place(relx=1, rely=1, anchor="se") + + def open_youtube(self): + webbrowser.open_new_tab("https://www.youtube.com/") # Открыть ссылку в браузере в новой вкладке + def run(self): self.root.mainloop()