-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_dpg_minimal.py
More file actions
executable file
·47 lines (34 loc) · 1.24 KB
/
test_dpg_minimal.py
File metadata and controls
executable file
·47 lines (34 loc) · 1.24 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env python3
"""
Minimal test script for DearPyGui in OneTrainer
This script tests basic DearPyGui functionality to verify it's working correctly.
"""
import os
import sys
import dearpygui.dearpygui as dpg
def main():
print("Testing DearPyGui installation...")
# Print version
print(f"DearPyGui version: {dpg.__version__}")
# Create context
dpg.create_context()
# Create viewport
dpg.create_viewport(title="DearPyGui Test", width=600, height=400)
# Setup DearPyGui
dpg.setup_dearpygui()
# Create main window
with dpg.window(tag="main_window", label="DearPyGui Test", width=600, height=400):
dpg.add_text("DearPyGui is working correctly!")
dpg.add_button(label="Click Me", callback=lambda: dpg.set_value("status", "Button clicked!"))
dpg.add_text("Status: ", tag="status")
# Set primary window
dpg.set_primary_window("main_window", True)
# Show viewport and start main loop
dpg.show_viewport()
print("DearPyGui test window opened. Close the window to exit.")
dpg.start_dearpygui()
dpg.destroy_context()
print("DearPyGui test completed successfully.")
return 0
if __name__ == "__main__":
sys.exit(main())