Windows¶
Contents
Summary
Container for static functions used to manipulate the main window. |
|
Creates a new window. |
|
A menu bar that can be added to a |
Main Window¶
- class dearpygui_obj.window.MainWindow(*args, **kwargs)[source]¶
Bases:
objectContainer for static functions used to manipulate the main window.
Attempting to instantiate this class will raise a
TypeError.Warning
The viewport only exists when the GUI engine is running (see
dearpygui_obj.is_running()). Some of the methods contained in this class may fail if called when the engine is not running.- static set_primary_window(window: Optional[Window]) None[source]¶
Set a window as the primary window, or remove the primary window.
When a window is set as the primary window it will fill the entire viewport.
If any other window was already set as the primary window, it will be unset.
- static set_resize_callback(callback: Callable)[source]¶
Set a callback for when the main viewport is resized.
- static enable_docking(**kwargs)[source]¶
Enable docking and set docking options.
Note
Once docking is enabled, it cannot be disabled.
- Keyword Arguments
shift_only – if
True, hold down shift for docking. IfFalse, dock by dragging window titlebars.dock_space – if
True, windows will be able to dock with the main window viewport.
- foreground = <dearpygui_obj.window.MainWindow._ForegroundCanvas object>¶
A special
DrawingCanvasthat can be used to draw on the foreground of the viewport.
- background = <dearpygui_obj.window.MainWindow._BackgroundCanvas object>¶
A special
DrawingCanvasthat can be used to draw on the background of the viewport.
Window¶
- class dearpygui_obj.window.Window(label: Optional[str] = None, **config)[source]¶
Bases:
dearpygui_obj.wrapper.widget.Widget,dearpygui_obj.wrapper.widget.ContainerWidgetMx[Window]Creates a new window.
Read or modify the ‘menubar’ config property.
- on_close(callback: Optional[PyGuiCallback]) Callable[source]¶
Set on_close callback, can be used as a decorator.
- resized(callback: PyGuiCallback) Callable[source]¶
Set resized callback, can be used as a decorator.
- get_canvas() dearpygui_obj.drawing.WindowCanvas[source]¶
Obtain a
WindowCanvasthat can be used to draw on the window using the drawing API.
- class dearpygui_obj.window.MenuBar(**config)[source]¶
Bases:
dearpygui_obj.wrapper.widget.Widget,dearpygui_obj.wrapper.widget.ItemWidgetMx,dearpygui_obj.wrapper.widget.ContainerWidgetMx[MenuBar]A menu bar that can be added to a
Window.