NotificationBox is a widget to display messages to the user. It immediately attracts the user's attention and can be used to inform the user about important events, such as the successful completion of a task, errors during execution, or the need to make adjustments to the annotation. NotificationBox supports various levels of messages, such as informational, success, warning, and error.
Function signature
note_box =NotificationBox(title="Notification Box",description="Lorem ipsum dolor sit amet...",box_type="info",widget_id=None)
note_box = NotificationBox(description="Lorem ipsum dolor sit amet...")
note_box_success = NotificationBox(
title="Box type: SUCCESS",
description="Lorem ipsum dolor sit amet... anim id est laborum.",
box_type="success"
)
note_box_info = NotificationBox(
title="Box type: INFO",
description="Lorem ipsum dolor sit amet... anim id est laborum.",
box_type="info"
)
note_box_warning = NotificationBox(
title="Box type: WARNING",
description="Lorem ipsum dolor sit amet... anim id est laborum.",
box_type="warning"
)
note_box_warning = NotificationBox(
title="Box type: WARNING",
description="Lorem ipsum dolor sit amet... anim id est laborum.",
box_type="warning"
)
note_box_error = NotificationBox(
title="Box type: ERROR",
description="Lorem ipsum dolor sit amet... anim id est laborum.",
box_type="error"
)
import os
from time import sleep
import supervisely as sly
from dotenv import load_dotenv
from supervisely.app.widgets import Button, Card, Container, Flexbox, NotificationBox
load_dotenv("local.env")
load_dotenv(os.path.expanduser("~/supervisely.env"))
api = sly.Api()
note_box_info = NotificationBox()
note_box_info.hide() # hide widget (you can show it later)
note_box_success = NotificationBox(title="Finished.", box_type="success")
note_box_success.hide()
note_box_error = NotificationBox(title="Error.", box_type="error")
note_box_error.hide()
note_box_warning = NotificationBox(title="Warning.", box_type="warning")
note_box_warning.hide()