Extension: omni.kit.mainwindow-1.0.3 |
Documentation Generated: Dec 17, 2024 |
Usage Examples#
Check MainWindow Initialization#
from omni.kit.mainwindow import get_main_window
# Check if the main window has been properly initialized
main_window = get_main_window()
assert main_window is not None
Validate DockSpace Window#
import omni.ui as ui
import omni.kit.app
import asyncio
# Validate the existence of the DockSpace window
async def check_dockspace():
await omni.kit.app.get_app().next_update_async()
main_dockspace = ui.Workspace.get_window("DockSpace")
assert main_dockspace is not None
# Example usage (this needs to be run inside an async context)
asyncio.ensure_future(check_dockspace())