From 0ea190122e3804724ef377811274833e3212bf3a Mon Sep 17 00:00:00 2001 From: kromskii2 <146603192+kromskii2@users.noreply.github.com> Date: Mon, 25 Mar 2024 19:51:02 +0700 Subject: [PATCH] =?UTF-8?q?=D0=A2=D0=BE=D0=BB=D1=8C=D0=BA=D0=BE=20=D1=87?= =?UTF-8?q?=D1=82=D0=BE=20=D1=81=D0=BE=D0=B7=D0=B4=D0=B0=D0=BB=20=D0=BF?= =?UTF-8?q?=D1=80=D0=BE=D0=B5=D0=BA=D1=82=20=D0=B8=20=D0=BD=D0=B0=D0=BF?= =?UTF-8?q?=D0=B8=D1=81=D0=B0=D0=BB=20=D0=B3=D0=BB=D0=B0=D0=B2=D0=BD=D0=BE?= =?UTF-8?q?=D0=B5=20=D0=BC=D0=B5=D0=BD=D1=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Menu.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Menu.py diff --git a/Menu.py b/Menu.py new file mode 100644 index 0000000..b122eff --- /dev/null +++ b/Menu.py @@ -0,0 +1,38 @@ +import tkinter as tk + + +class RoundedMenuApp: + def __init__(self, width, height, corner_radius): + self.width = width + self.height = height + self.corner_radius = corner_radius + + self.root = tk.Tk() + self.root.title("Rounded Menu") + self.root.geometry(f"{width}x{height}") + + self.canvas = tk.Canvas(self.root, width=width, height=height, bg="white", highlightthickness=0) + self.canvas.pack() + + self.draw_rounded_corners() + + def draw_rounded_corners(self): + x0, y0 = 0, 0 + x1, y1 = self.width, self.height + radius = self.corner_radius + self.canvas.create_arc(x0, y0, x0 + radius * 2, y0 + radius * 2, start=90, extent=90, fill="white", + outline="white") + self.canvas.create_arc(x1 - radius * 2, y0, x1, y0 + radius * 2, start=0, extent=90, fill="white", + outline="white") + self.canvas.create_arc(x0, y1 - radius * 2, x0 + radius * 2, y1, start=180, extent=90, fill="white", + outline="white") + self.canvas.create_arc(x1 - radius * 2, y1 - radius * 2, x1, y1, start=270, extent=90, fill="white", + outline="white") + + def run(self): + self.root.mainloop() + + +# Создание и запуск приложения +app = RoundedMenuApp(width=646, height=396, corner_radius=30) +app.run()