Skip to content

Commit 2107702

Browse files
committed
Add some dearpygui examples
1 parent 4e32dad commit 2107702

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

dearpygui_examples/dearpy_demo.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# dearpygui demo from docs
2+
3+
import dearpygui.dearpygui as dpg
4+
import dearpygui.demo as demo
5+
6+
dpg.create_context()
7+
dpg.create_viewport(title='Custom Title', width=600, height=600)
8+
9+
demo.show_demo()
10+
11+
dpg.setup_dearpygui()
12+
dpg.show_viewport()
13+
dpg.start_dearpygui()
14+
dpg.destroy_context()

dearpygui_examples/hello_world.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import dearpygui.dearpygui as dpg
2+
3+
def hello_callback():
4+
print("Hello from DPG")
5+
6+
dpg.create_context()
7+
dpg.create_viewport()
8+
dpg.setup_dearpygui()
9+
10+
with dpg.window(label="Example Window"):
11+
dpg.add_text("Hello world text")
12+
dpg.add_button(label="Hello button", callback=hello_callback)
13+
14+
dpg.show_viewport()
15+
dpg.start_dearpygui()
16+
dpg.destroy_context()

0 commit comments

Comments
 (0)