swaping from tkinter to DearPyGUI

This commit is contained in:
Brightbites
2026-02-04 21:47:32 +00:00
parent ecca691ac2
commit eb884f5c12
2 changed files with 33 additions and 35 deletions

33
DearPyGUITest.py Normal file
View File

@@ -0,0 +1,33 @@
import dearpygui.dearpygui as dpg
dpg.create_context()
dpg.create_viewport(title='RocketLaunchCountdown', width=600, height=400)
def start():
print("Start pressed")
def hold():
print("Hold pressed")
def scrub():
print("Scrub pressed")
with dpg.window(tag="Primary Window"):
dpg.add_text("T- " + "00:00:00")
dpg.add_separator()
with dpg.group(horizontal=True):
dpg.add_button(label="Start", callback=start)
dpg.add_button(label="Hold", callback=hold)
dpg.add_button(label="Scrub", callback=scrub)
with dpg.group() as group1:
pass
dpg.show_metrics()
dpg.show_style_editor()
dpg.setup_dearpygui()
dpg.show_viewport()
dpg.set_primary_window("Primary Window", True)
dpg.start_dearpygui()
dpg.destroy_context()

View File

@@ -1,35 +0,0 @@
import tkinter as tk
root = tk.Tk()
root.title("RocketLaunchCountdown")
root.configure(bg="Black")
tk.Grid.rowconfigure(root,(1),weight=1, uniform="a")
tk.Grid.columnconfigure(root,(0,1,2,3,4,5,6),weight=1, uniform="a")
tk.Grid.rowconfigure(root,(0,2,3), weight=2, uniform="a")
Tminus = tk.Label(root, text="t-").grid(row=0, column=0, sticky="new")
label = tk.Label(root, text="00:00:00").grid(row=0,column=1, columnspan=6, sticky="new")
var1 = tk.IntVar()
tk.Checkbutton(root, text="TimeTill", variable=var1, fg="White", bg="Black").grid(row=1,column=6, padx=5, sticky="ew")
tk.Text(root, height = 1, width = 4, bg = "White").grid(row=1,column=0, padx=5, sticky="ew")
tk.Text(root, height = 1, width = 4, bg = "White").grid(row=1,column=1, padx=5, sticky="ew")
tk.Text(root, height = 1, width = 4, bg = "White").grid(row=1,column=2, padx=5, sticky="ew")
tk.Text(root, height = 1, width = 4, bg = "White").grid(row=1,column=3, padx=5, sticky="ew")
tk.Text(root, height = 1, width = 4, bg = "White").grid(row=1,column=4, padx=5, sticky="ew")
tk.Text(root, height = 1, width = 4, bg = "White").grid(row=1,column=5, padx=5, sticky="ew")
controlbar = tk.Frame(root)
controlbar.grid(row=2, column=0, columnspan=7)
Start = tk.Button(controlbar, text="Exit", width=10).grid(row=0, column=0, sticky="nsew")
Hold = tk.Button(controlbar, text="Exit", width=10).grid(row=0, column=1, sticky="nsew")
Stop = tk.Button(controlbar, text="Exit", width=10).grid(row=0, column=2, sticky="nsew")
button = tk.Button(root, text="Exit", width=10, command=root.destroy).grid(row=3,column=2, columnspan=3, sticky="sew")
label = tk.Label(root, text="Made by: HampsterSpaceNerd3000, Rewriten by: Brightbites").grid(row=4,column=0, columnspan=7, sticky="sew")
root.mainloop()