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
|
import dearpygui.dearpygui as dpg
dpg.create_context()
with dpg.window(label="Tutorial", pos=(20, 50), width=275, height=225) as win1:
t1 = dpg.add_input_text(default_value="some text")
t2 = dpg.add_input_text(default_value="some text")
with dpg.child_window(height=100):
t3 = dpg.add_input_text(default_value="some text")
dpg.add_input_int()
dpg.add_input_text(default_value="some text")
with dpg.window(label="Tutorial", pos=(320, 50), width=275, height=225) as win2:
dpg.add_input_text(default_value="some text")
dpg.add_input_int()
with dpg.theme() as container_theme:
with dpg.theme_component(dpg.mvAll):
dpg.add_theme_color(dpg.mvThemeCol_FrameBg, (150, 100, 100), category=dpg.mvThemeCat_Core)
dpg.add_theme_style(dpg.mvStyleVar_FrameRounding, 5, category=dpg.mvThemeCat_Core)
with dpg.theme_component(dpg.mvInputInt):
dpg.add_theme_color(dpg.mvThemeCol_FrameBg, (100, 150, 100), category=dpg.mvThemeCat_Core)
dpg.add_theme_style(dpg.mvStyleVar_FrameRounding, 5, category=dpg.mvThemeCat_Core)
dpg.bind_item_theme(win1, container_theme)
dpg.show_style_editor()
dpg.create_viewport(title='Custom Title', width=800, height=600)
dpg.setup_dearpygui()
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()
|