diff --git a/GraphicUser_InterFace/Display_availability.py b/GraphicUser_InterFace/Display_availability.py index f031519..19a3341 100644 --- a/GraphicUser_InterFace/Display_availability.py +++ b/GraphicUser_InterFace/Display_availability.py @@ -3,6 +3,14 @@ import Modules.FileHandling as File class Available(customtkinter.CTk): + """ + Class representing the Route Information Page GUI. + + Attributes: + textbox: Textbox to display available routes. + combobox: ComboBox to select a specific route. + button: Button to proceed with the selected route. + """ def __init__(self): super().__init__() @@ -13,11 +21,12 @@ def __init__(self): self.grid_rowconfigure(0, weight=1) self.grid_columnconfigure((0, 1), weight=1) + # Textbox for displaying available routes self.textbox = customtkinter.CTkTextbox(master=self) self.textbox.grid(row=0, column=0, columnspan=2, padx=20, pady=(20, 0), sticky="nsew") self.textbox.configure(font=("Arial", 18)) - + # Fetching available routes from the file and displaying them AvailableList = sql.Query_FetchFromFile() AvailableList.reverse() list=[] @@ -29,13 +38,18 @@ def __init__(self): list.append("Select") list.reverse() + # ComboBox for route selection self.combobox = customtkinter.CTkComboBox(master=self, values=list) self.combobox.grid(row=1, column=0, padx=20, pady=20, sticky="ew") + # Button to proceed with the selected route self.button = customtkinter.CTkButton(master=self, command=self.button_callback, text="Proceed") self.button.grid(row=1, column=1, padx=20, pady=20, sticky="ew") def button_callback(self): + """ + Callback function for the button to handle the selected route and proceed to the payment page. + """ selection = self.combobox.get() File.Handle_Selection(selection) self.destroy() @@ -45,4 +59,4 @@ def button_callback(self): if __name__ == "__main__": Available = App() - Available.mainloop() \ No newline at end of file + Available.mainloop()