Notification that will be displayed when there are no classes in the widget.
type:NotificationBox
defaultNone
empty_notificaiton =NotificationBox( title="No classes", description="Provide classes to widget in order to map new names.")classes_mapping =ClassesMapping( classes=obj_classes, empty_notification=empty_notificaiton)
widget_id
ID of the widget.
type:str
default value:None
Methods and attributes
Attributes and Methods
Description
set()
Set classes to widget.
get_classes()
Return list of all classes.
get_mapping()
Return edited classes mapping, if there were any changes.
ignore()
Ignore classes by indexes.
set_default()
Revert changes.
set_mapping()
Set new classes mapping.
select_all()
Select all classes.
deselect_all()
Deselect all classes.
select()
Select classes by ObjClass.
@selection_changed
Callback triggers when selection is changed.
Mini App Example
You can find this example in our Github repository:
Initialize ClassesMapping widget, NotificationBox widget for custom notification
empty_notification =NotificationBox( title="No classes", description="Provide classes to widget in order to map new names.")classes_mapping =ClassesMapping( classes=obj_classes, empty_notification=empty_notification)
Create Text widget for displaying changes and Button widget for saving changes
new_classes_names =Text(f"Press button to save changes", "info")save_button =Button("Save", button_size="mini")
Create app layout
Prepare a layout for the app using the Card widget with the content parameter and place the widget that we've just created into the Container widget.