-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsimple_dpg_test.py
More file actions
32 lines (25 loc) · 803 Bytes
/
simple_dpg_test.py
File metadata and controls
32 lines (25 loc) · 803 Bytes
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
32
#!/usr/bin/env python3
"""
Simple DPG test to verify environment
"""
import sys
try:
import dearpygui.dearpygui as dpg
except ImportError:
print("DearPyGui not found. Please install it with: pip install dearpygui")
sys.exit(1)
print(f"DearPyGui version: {dpg.__version__}")
def run_test():
"""Run a simple DPG test"""
dpg.create_context()
dpg.create_viewport(title="DPG Test", width=600, height=400)
with dpg.window(label="Hello World", width=600, height=400):
dpg.add_text("Hello, world!")
dpg.add_button(label="Click Me", callback=lambda: print("Button clicked!"))
dpg.setup_dearpygui()
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()
if __name__ == "__main__":
print("Starting DPG test...")
run_test()