Ui for controlling timer implimented
This commit is contained in:
@@ -3,25 +3,37 @@ import dearpygui.dearpygui as dpg
|
||||
dpg.create_context()
|
||||
dpg.create_viewport(title='RocketLaunchCountdown', width=600, height=400)
|
||||
|
||||
TLToggle = False
|
||||
|
||||
def start():
|
||||
print("Start pressed")
|
||||
if TLToggle:
|
||||
dpg.set_value("text item", "00:00:00")
|
||||
else: dpg.set_value("text item", "00:00:01")
|
||||
|
||||
def hold():
|
||||
print("Hold pressed")
|
||||
|
||||
def scrub():
|
||||
print("Scrub pressed")
|
||||
dpg.set_value("text item", "SCRUB")
|
||||
|
||||
def Ttoggle():
|
||||
global TLToggle
|
||||
if TLToggle:
|
||||
TLToggle = False
|
||||
else: TLToggle = True
|
||||
print(TLToggle)
|
||||
|
||||
with dpg.window(tag="Primary Window"):
|
||||
dpg.add_text("T- " + "00:00:00")
|
||||
dpg.add_text("T- 00:00:00", tag="text item")
|
||||
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.add_button(label="Toggle T- L-", callback=Ttoggle)
|
||||
|
||||
|
||||
dpg.show_metrics()
|
||||
dpg.show_style_editor()
|
||||
|
||||
Reference in New Issue
Block a user