From e2a1eca6b72f02055f189cf008d6e535c84aea2e Mon Sep 17 00:00:00 2001 From: "DHR.Mike" Date: Mon, 1 Dec 2025 13:45:59 -0800 Subject: [PATCH] Update Uptated-Prototype/PiperTTS-GUI-Test.py --- Uptated-Prototype/PiperTTS-GUI-Test.py | 45 ++++++++++++++------------ 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/Uptated-Prototype/PiperTTS-GUI-Test.py b/Uptated-Prototype/PiperTTS-GUI-Test.py index f561e64..2506c10 100644 --- a/Uptated-Prototype/PiperTTS-GUI-Test.py +++ b/Uptated-Prototype/PiperTTS-GUI-Test.py @@ -16,6 +16,7 @@ Window_PosX = (Screen_Width/2) - (Window_Width/2) Window_PosY = (Screen_Height/2) - (Window_Height/2) # Setting up Window in Center Root_Window.geometry(f'{Window_Width}x{Window_Height}+{int(Window_PosX)}+{int(Window_PosY)}') # Sets the GUI geometry +#Root_Window.minsize(Window_Width, Window_Height) # Attempts to make a Input box try: @@ -26,31 +27,33 @@ except: try: Controls_Box_Frame = Frame(Root_Window) except: - print("An exception occurred - when creating Controls Frame.") + print("An exception occurred - when creating Controls Frame.") try: Input_Box_Frame.place(x = 0, y = 0, relwidth = 1, relheight = 0.8) Controls_Box_Frame.place(x = 0, rely = 0.8, relwidth = 1, relheight = 0.8) except: - print("An exception occurred - when placing Frames.") - - #Input_Box_Frame.grid(row=0, column=0, columnspan=5, padx=10, pady=20, sticky="NSEW") - - #Main_Text_Scrollbar = Scrollbar(Input_Box_Frame) - #Main_Text_Scrollbar.pack(side=RIGHT, fill=y) + print("An exception occurred - when placing Frames.") try: - Input_Box = Text(Input_Box_Frame, Yscrollcommand=Main_Text_Scrollbar.set) - Input_Box.pack(padx=20, pady=20) + Input_Box = Text(Input_Box_Frame) + Input_Box.pack(padx=20, pady=20, expand = True, fill = "both") except: print("An exception occurred - when creating input box.") +try: + Main_Text_Scrollbar = Scrollbar(Input_Box_Frame, command = Input_Box_Frame.yview) + Input_Box_Frame.configure(yscrollcommand = Main_Text_Scrollbar.set) + Main_Text_Scrollbar.place(relx = 1, rely = 0, relheight = 1 anchor = "ne") +except: + print("An exception occurred - when creating a scroll bar.") + # def PiperTTS_GUI_Play(): try: - PiperTTS_GUI_Hide_All_Labels() + #PiperTTS_GUI_Hide_All_Labels() My_Label = Label(Controls_Box_Frame, text="Playing?").grid(row=3, column=0, columnspan=5) - global labels = [] + #global labels = [] labels.append(My_Label) C_Button_Pause["state"] == "normal" C_Button_Pause["state"] = "disabled" @@ -60,9 +63,9 @@ def PiperTTS_GUI_Play(): # def PiperTTS_GUI_Pause(): try: - PiperTTS_GUI_Hide_All_Labels() + #PiperTTS_GUI_Hide_All_Labels() My_Label = Label(Controls_Box_Frame, text="Pause?").grid(row=3, column=0, columnspan=5) - global labels = [] + #global labels = [] labels.append(My_Label) C_Button_Pause["state"] == "disabled" C_Button_Pause["state"] = "normal" @@ -72,9 +75,9 @@ def PiperTTS_GUI_Pause(): # def PiperTTS_GUI_Stop(): try: - PiperTTS_GUI_Hide_All_Labels() + #PiperTTS_GUI_Hide_All_Labels() My_Label = Label(Controls_Box_Frame, text="Stop?").grid(row=3, column=0, columnspan=5) - global labels = [] + #global labels = [] labels.append(My_Label) except: print("An exception occurred - when pressing Stop Button.") @@ -82,9 +85,9 @@ def PiperTTS_GUI_Stop(): # def PiperTTS_GUI_Previous(): try: - PiperTTS_GUI_Hide_All_Labels() + #PiperTTS_GUI_Hide_All_Labels() My_Label = Label(Controls_Box_Frame, text="Previous?").grid(row=3, column=0, columnspan=5) - global labels = [] + #global labels = [] labels.append(My_Label) except: print("An exception occurred - when pressing Previous Button.") @@ -92,9 +95,9 @@ def PiperTTS_GUI_Previous(): # def PiperTTS_GUI_Next(): try: - PiperTTS_GUI_Hide_All_Labels() + #PiperTTS_GUI_Hide_All_Labels() My_Label = Label(Controls_Box_Frame, text="Next?").grid(row=3, column=0, columnspan=5) - global labels = [] + #global labels = [] labels.append(My_Label) except: print("An exception occurred - when pressing Next Button.") @@ -102,9 +105,9 @@ def PiperTTS_GUI_Next(): # def PiperTTS_GUI_Clipboard(): try: - PiperTTS_GUI_Hide_All_Labels() + #PiperTTS_GUI_Hide_All_Labels() My_Label = Label(Controls_Box_Frame, text="Clipboard?").grid(row=3, column=0, columnspan=5) - global labels = [] + #global labels = [] labels.append(My_Label) except: print("An exception occurred - when pressing Clipboard Button.")