-
Notifications
You must be signed in to change notification settings - Fork 0
/
gui.py
31 lines (23 loc) · 1.82 KB
/
gui.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import tkinter as tk # Importing the tkinter module for creating the GUI
from tkinter.scrolledtext import ScrolledText # Importing ScrolledText for displaying output
class DiscordCodeCheckerGUI: # Defining the class for the GUI
def __init__(self, master): # Initializing the class with the master (root) window
self.master = master # Setting the master window as an attribute of the class
master.title("Discord Code Checker") # Setting the title of the master window
self.label = tk.Label(master, text="Output:") # Creating a label for the output
self.label.pack() # Packing the label to display it
self.output_text = ScrolledText(master, height=20, width=50) # Creating a ScrolledText widget for displaying output
self.output_text.pack() # Packing the ScrolledText widget to display it
self.check_button = tk.Button(master, text="Check Codes", command=self.check_codes) # Creating a button for checking codes
self.check_button.pack() # Packing the button to display it
def check_codes(self): # Defining the function for checking codes
# Clear previous output
self.output_text.delete('1.0', tk.END) # Clearing the previous output from the ScrolledText widget
# Here you can add the logic to check codes and display the output in the GUI
self.output_text.insert(tk.END, "This feature is not implemented yet.") # Displaying a message indicating that the feature is not implemented yet
def main(): # Defining the main function
root = tk.Tk() # Creating the master window
app = DiscordCodeCheckerGUI(root) # Creating an instance of the DiscordCodeCheckerGUI class with the master window
root.mainloop() # Starting the main event loop
if __name__ == "__main__": # Checking if the script is being run directly
main() # Calling the main function