Dialog
Introduction
Dialog
is a widget that allows to show a dialog window that contain any other widgets. It can be used to show a message to the user or to ask for confirmation.
Read this tutorial in developer portal.
Function signature
Parameters
Parameters | Type | Description |
---|---|---|
|
| Title of the dialog window |
|
| Widget to display in dialog window |
|
| Size of the dialog window |
|
| ID of the widget |
title
Title of the dialog window that will be displayed in the header.
type: str
default value: ""
content
Widget to display in the dialog window. Use Container
widget to display multiple widgets.
type: Widget
default value: None
size
Width of the annotation border (contour) line. Set to 0 to hide a line.
type: Literal["tiny", "small", "large", "full"]
default value: "small"
widget_id
ID of the widget.
type: str
default value: None
Methods and attributes
Attributes and Methods | Description |
---|---|
| Open (show) dialog window. |
| Close (hide) dialog window. |
| Set title for dialog window |
Mini App Example
You can find this example in our Github repository: supervisely-ecosystem/ui-widgets-demos/layouts and containers/016_dialog/src/main.py
Import libraries
Init API client
First, we load environment variables with credentials and init API for communicating with Supervisely Instance:
Initialize content widgets for Dialog
Initialize Dialog widget
Create button to open Dialog
Create app layout
Prepare a layout for app using Card
widget with the content
parameter and place Button for opening dialog to the content.
Create app using layout
Add Container widget with card and dialog widgets to the app layout.
Add button click event to update open and close Dialog
Last updated