Last active
March 2, 2024 10:32
-
-
Save damp11113/f67eac027fda154f3490e401ad812ce8 to your computer and use it in GitHub Desktop.
dearpygui project template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import dearpygui.dearpygui as dpg | |
class App: | |
def __init__(self): | |
pass | |
def window(self): | |
with dpg.window(label="Test"): | |
dpg.add_text("Hello world") | |
def init(self): | |
dpg.create_context() | |
dpg.create_viewport(title='Test', width=1280, height=720) # set viewport window | |
dpg.setup_dearpygui() | |
# -------------- add code here -------------- | |
self.window() | |
# ------------------------------------------- | |
dpg.show_viewport() | |
while dpg.is_dearpygui_running(): | |
self.render() | |
dpg.render_dearpygui_frame() | |
dpg.destroy_context() | |
def render(self): | |
# insert here any code you would like to run in the render loop | |
# you can manually stop by using stop_dearpygui() or self.exit() | |
pass | |
def exit(self): | |
dpg.destroy_context() | |
app = App() | |
app.init() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment