From e591c6619cb8754b9af7efe293ce3b4a8e7c024a Mon Sep 17 00:00:00 2001 From: kromskii2 <146603192+kromskii2@users.noreply.github.com> Date: Mon, 25 Mar 2024 20:46:12 +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=D0=BF?= =?UTF-8?q?=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D0=B8=20=D0=BE=D0=B1=D0=BD?= =?UTF-8?q?=D0=BE=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Menu.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Menu.py b/Menu.py index fb7c7a5..f23eaea 100644 --- a/Menu.py +++ b/Menu.py @@ -29,6 +29,7 @@ class RoundedMenuApp: self.draw_rounded_corners() self.create_youtube_button() self.create_license_button() # Added the license button + self.create_update_button() # Added the update button # Create a label to display the time self.time_label = tk.Label(self.root, text="", font=("Arial", 12)) @@ -58,12 +59,22 @@ class RoundedMenuApp: license_button = tk.Button(self.root, text="License", command=self.open_license) license_button.place(relx=0, rely=1, anchor="sw") + def create_update_button(self): + update_button = tk.Button(self.root, text="Проверить обновление", command=self.open_update) + update_button.place(relx=0.5, rely=0.5, anchor="center") + async def async_open_license(self): await asyncio.create_subprocess_exec('python', 'License-agreement.py') + async def async_open_update(self): + await asyncio.create_subprocess_exec('python', 'check-the-update.py') + def open_license(self): asyncio.run(self.async_open_license()) # Run the async function in a synchronous context + def open_update(self): + asyncio.run(self.async_open_update()) # Run the async function in a synchronous context + def open_youtube(self): webbrowser.open_new_tab("https://www.youtube.com/")