API

  • SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.

  • SPDX-License-Identifier: Apache-2.0

  • Licensed under the Apache License, Version 2.0 (the “License”);

  • you may not use this file except in compliance with the License.

  • You may obtain a copy of the License at

  • https://www.apache.org/licenses/LICENSE-2.0

  • Unless required by applicable law or agreed to in writing, software

  • distributed under the License is distributed on an “AS IS” BASIS,

  • WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

  • See the License for the specific language governing permissions and

  • limitations under the License.

class omni.flux.welcome_pad.widget.WelcomePadWidget(model: Optional[omni.flux.welcome_pad.widget.model.Model] = None, show_footer: bool = True, footer: Optional[str] = None, footer_callback: Optional[Callable[[float, float, int, int], None]] = None, title: Optional[str] = None, auto_resize_list: bool = True, word_wrap_description: bool = True, create_demo_items: bool = True)

Bases: object

__init__(model: Optional[omni.flux.welcome_pad.widget.model.Model] = None, show_footer: bool = True, footer: Optional[str] = None, footer_callback: Optional[Callable[[float, float, int, int], None]] = None, title: Optional[str] = None, auto_resize_list: bool = True, word_wrap_description: bool = True, create_demo_items: bool = True)

Create a pad

Parameters
  • model – model that will feed the pad and show what we want

  • show_footer – show the footer or not

  • footer – text of the footer

  • footer_callback – function called when the user release the mouse from the footer text

  • title – title of your pad

  • auto_resize_list – if the list of items is bigger than the frame they are in, resize the list automatically

  • word_wrap_description – word wrap the description

  • create_demo_items – create default demo items

Returns

The created pad object

property delegate

Delegate of the tree

destroy()

Destroy.

get_current_selection() List[_Item]

Get selected item from the tree view

get_item_background_widgets() Dict[str, omni.ui._ui.Widget]

Get the background rectangle of all items

Returns

A list of rectangle

property model

Model of the treeview

resize_tree_content()

If the list of items is bigger than the frame they are in, resize the list automatically

set_current_selection(item: Optional[_Item])

Set the selection on the tree view

Parameters

item – the item to select

subscribe_selection_changed(callback)

Subscribe when the selection of the treeview change

  • SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.

  • SPDX-License-Identifier: Apache-2.0

  • Licensed under the Apache License, Version 2.0 (the “License”);

  • you may not use this file except in compliance with the License.

  • You may obtain a copy of the License at

  • https://www.apache.org/licenses/LICENSE-2.0

  • Unless required by applicable law or agreed to in writing, software

  • distributed under the License is distributed on an “AS IS” BASIS,

  • WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

  • See the License for the specific language governing permissions and

  • limitations under the License.

class omni.flux.welcome_pad.widget.model.Item(idt=None)

Bases: omni.ui._ui.AbstractItem

Item of the model

__init__(self: omni.ui._ui.AbstractItem) None
abstract property description

Description of the item that will be shown

description_override_delegate()

If use_description_override_delegate is True, this function will be executed to draw the description

Returns

The created widget

abstract get_image() str

Image that will be showed on the left

on_description_scrolled_x(x)

Action that will be called when the description is scrolled on x

on_description_scrolled_y(y)

Action that will be called when the description is scrolled on y

on_hovered(hovered)

Action that will be called when the item is hovered on

on_mouse_pressed()

Action that will be called when the item is clicked on

on_mouse_released()

Action that will be called when the item is released on

abstract property title

Title of the item that will be shown

title_override_delegate() omni.ui._ui.Widget

If use_title_override_delegate is True, this function will be executed to draw the title

Returns

The created widget

class omni.flux.welcome_pad.widget.model.Model(create_demo_items: bool = True)

Bases: omni.ui._ui.AbstractItemModel

List model

__init__(self: omni.ui._ui.AbstractItemModel) None

Constructs AbstractItemModel.

kwargs : dict

See below

### Keyword Arguments:

add_items(items: List[omni.flux.welcome_pad.widget.model.Item])

Add items into the list

destroy()
enable_items(items: List[omni.flux.welcome_pad.widget.model.Item], value)

Enable/disable items

Parameters
  • items – the list of items to set the value to

  • value – enable or disable

get_item_children(item)

Returns all the children when the widget asks it.

get_item_value_model(item, column_id)

Return value model. It’s the object that tracks the specific value. In our case we use ui.SimpleStringModel.

get_item_value_model_count(item)

The number of columns

get_items()

Get current items

get_list_limit()
get_size_data()

Get the size of the list of items

remove_items(items: List[omni.flux.welcome_pad.widget.model.Item])

Remove items from the list

set_items(items: List[omni.flux.welcome_pad.widget.model.Item])

Set items into the list

set_list_limit(limit_list: Optional[int])

Set a size limit into the list of items

subscribe_items_enabled(callback)

Return the object that will automatically unsubscribe when destroyed.