PageSwitcher
- class omni.kit.window.extensions.window.PageSwitcher
Bases:
object
A class to manage the visibility of different pages in a UI environment.
The class maintains a collection of pages, allowing only one to be visible at a time. It provides methods to add new pages, select a page to be visible, and remove all pages upon destruction.
Methods
__init__
()Initializes a new instance of the PageSwitcher, which manages switching between UI pages.
add_page
(name, widget)Adds a new page to the PageSwitcher.
destroy
()Destroys all pages managed by the PageSwitcher and resets its state.
select_page
(name[, force])Selects a page to be displayed in the PageSwitcher.
- __init__()
Initializes a new instance of the PageSwitcher, which manages switching between UI pages.
- add_page(name, widget)
Adds a new page to the PageSwitcher.
- Parameters
name (str) – The unique name of the page to add.
widget (
ui.Widget
) – The UI widget that represents the page content.
- destroy()
Destroys all pages managed by the PageSwitcher and resets its state.
- select_page(name, force=False)
Selects a page to be displayed in the PageSwitcher.
- Parameters
name (str) – The name of the page to select.
force (bool) – If True, forces the page to be selected even if it is already selected.