Skip to content
Snippets Groups Projects
Select Git revision
  • 17fbf0617d95e8ac40d35e7107b7cdcb7883e937
  • main default protected
2 results

dpygui.py

Blame
  • dpygui.py 2.97 KiB
    import dearpygui.dearpygui as dpg
    import dearpygui.demo as demo
    
    dpg.create_context()
    dpg.create_viewport(title='Custom Title', width=600, height=600)
    
    demo.show_demo()
    
    dpg.setup_dearpygui()
    dpg.show_viewport()
    dpg.set_primary_window("__demo_id", True)
    dpg.start_dearpygui()
    dpg.destroy_context()
    
    # List of default style items in Dear PyGui
    style_items = [
        dpg.mvStyleVar_Alpha,
    	dpg.mvStyleVar_WindowPadding,
    	dpg.mvStyleVar_WindowRounding,
    	dpg.mvStyleVar_WindowBorderSize,
    	dpg.mvStyleVar_WindowMinSize,
    	dpg.mvStyleVar_WindowTitleAlign,
    	dpg.mvStyleVar_ChildRounding,
    	dpg.mvStyleVar_ChildBorderSize,
    	dpg.mvStyleVar_PopupRounding,
    	dpg.mvStyleVar_PopupBorderSize,
    	dpg.mvStyleVar_FramePadding,
    	dpg.mvStyleVar_FrameRounding,
    	dpg.mvStyleVar_FrameBorderSize,
    	dpg.mvStyleVar_ItemSpacing,
    	dpg.mvStyleVar_ItemInnerSpacing,
    	dpg.mvStyleVar_IndentSpacing,
    	dpg.mvStyleVar_CellPadding,
    	dpg.mvStyleVar_ScrollbarSize,
    	dpg.mvStyleVar_ScrollbarRounding,
    	dpg.mvStyleVar_GrabMinSize,
    	dpg.mvStyleVar_GrabRounding,
    	dpg.mvStyleVar_TabRounding,
    	dpg.mvStyleVar_ButtonTextAlign,
    	dpg.mvStyleVar_SelectableTextAlign
    ]
    
    # # Function to print default styles
    # def print_default_styles():
    #     for item in dpg.get_all_items():
    #         print(dpg.get_item_info(item))
    #         print(dpg.get_item_theme(item))
    
    
    
    # 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.tab_bar(reorderable=True):
    #         with dpg.tab(label="Tab 1"):
    #             dpg.add_text("This is Tab 1")
    #         with dpg.tab(label="Tab 2"):
    #             dpg.add_text("This is Tab 2")
    #         with dpg.tab(label="Tab 3"):
    #             dpg.add_text("This is Tab 3")
    #     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_Tab, (150, 100, 100), category=dpg.mvThemeCat_Core)
    #         dpg.add_theme_style(dpg.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.dpg.mvStyleVar_FrameRounding, 5, category=dpg.mvThemeCat_Core)
    
    # dpg.bind_item_theme(win1, container_theme)
    # dpg.bind_theme(container_theme)
    
    # dpg.create_viewport(title='Custom Title', width=800, height=600)
    # dpg.setup_dearpygui()
    # dpg.show_viewport()
    # dpg.start_dearpygui()
    # dpg.destroy_context()
    
    # import dearpygui.dearpygui as dpg
    
    # dpg.create_context()
    # dpg.create_viewport()
    # dpg.setup_dearpygui()
    
    # dpg.show_font_manager()
    
    # dpg.show_viewport()
    # dpg.start_dearpygui()
    # dpg.destroy_context()