From fd8874d80b35ea419bfe112c13550e3984e6e7e0 Mon Sep 17 00:00:00 2001 From: "DHR.Mike" Date: Tue, 16 Dec 2025 09:48:23 -0800 Subject: [PATCH] Add Uptated-Prototype/Class-Based-GUI-Test.py --- Uptated-Prototype/Class-Based-GUI-Test.py | 44 +++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 Uptated-Prototype/Class-Based-GUI-Test.py diff --git a/Uptated-Prototype/Class-Based-GUI-Test.py b/Uptated-Prototype/Class-Based-GUI-Test.py new file mode 100644 index 0000000..7cdce46 --- /dev/null +++ b/Uptated-Prototype/Class-Based-GUI-Test.py @@ -0,0 +1,44 @@ +import tkinter as tk +from tkinter import ttk + +class MyApp(tk.Tk): + def __init__(self): + super().__init__() + self.title("PiperTTS - Prototype GUI Class Based") # Sets the GUI Title + Window_Width, Window_Height = 420, 570 # Defining Window Starting Size + Screen_Width, Screen_Height = self.winfo_screenwidth(), self.winfo_screenheight() # Getting Screen Width and Height + Window_PosX, Window_PosY = (Screen_Width/2) - (Window_Width/2), (Screen_Height/2) - (Window_Height/2) # Calculate Center of Screen for the window + self.geometry(f'{Window_Width}x{Window_Height}+{int(Window_PosX)}+{int(Window_PosY)}') # Sets Window Size And Starting Position + self..minsize(Window_Width, Window_Height) # Defining Window Minimum Size + + self.MainTextWidget = MainTextWidget(self) # Creates Text input Frame + + self.MainPlaybackWidget = MainPlaybackWidget(self) # Creates Playback button Frame + + self.mainloop() + + +class MainTextWidget(ttk.Frame): + def __init__(self, parent): + super().__init__(parent) + self.pack(fill = "both", expand = True) + + Input_Box = tk.Text(self, selectbackground="yellow", selectforeground="black", undo=True) + Input_Box.pack(side = LEFT, padx=5, pady=5, expand = True, fill = "both") + +class MainPlaybackWidget(ttk.Frame): + def __init__(self, parent): + super().__init__(parent) + self.pack(fill = "both") + + GUI_Button_PlayAndPause = ttk.Button(self, text="▶") + GUI_Button_Stop = ttk.Button(self, text="⏹") + GUI_Button_previous = ttk.Button(self, text="⏮") + GUI_Button_Next = ttk.Button(self, text="⏭") + + GUI_Button_PlayAndPause.grid(row=0, column=0) + GUI_Button_previous.grid(row=0, column=1) + GUI_Button_Stop.grid(row=0, column=2) + GUI_Button_Next.grid(row=0, column=3) + +MyApp() \ No newline at end of file