MessageDialog#
- class omni.kit.window.popup_dialog.MessageDialog(
- width: int = 400,
- parent: Widget = None,
- message: str = '',
- title: str = None,
- ok_handler: Callable[[AbstractDialog], None] = None,
- cancel_handler: Callable[[AbstractDialog], None] = None,
- ok_label: str = 'Ok',
- cancel_label: str = 'Cancel',
- disable_okay_button: bool = False,
- disable_cancel_button: bool = False,
- warning_message: str | None = None,
Bases:
PopupDialogThis simplest of all popup dialogs displays a confirmation message before executing an action.
- Keyword Arguments:
width (int) – Width of popup window. Default 400.
( (parent) – obj:’omni.ui.Widget’):OBSOLETE.
message (str) – The displayed message. Default ‘’.
title (str) – Title of popup window. Default None.
ok_handler (Callable[[AbstractDialog], None]) – Handler called when click ok button. Default None. Function signature is: void ok_handler(AbstractDialog)
cancel_handler (Callable[[AbstractDialog], None]) – Handler called when click cancel button. Default None. Function signature is: void ok_handler(AbstractDialog)
ok_label (str) – Label text for ok button. Default “Ok”.
cancel_label (str) – Label text for cancel button. Default “Cancel”.
disable_okay_button (bool) – If True, then don’t display ‘Ok’ button. Default False.
disable_cancel_button (bool) – If True, then don’t display ‘Cancel’ button. Default False.
warning_message (Optional[str]) – Warning message that will displayed in red with the warning glyph. Default None.
Methods
__init__([width, parent, message, title, ...])Inherited args from the base class.
destroy()Destructor
set_message(message)Updates the message string.
Attributes
- __init__(
- width: int = 400,
- parent: Widget = None,
- message: str = '',
- title: str = None,
- ok_handler: Callable[[AbstractDialog], None] = None,
- cancel_handler: Callable[[AbstractDialog], None] = None,
- ok_label: str = 'Ok',
- cancel_label: str = 'Cancel',
- disable_okay_button: bool = False,
- disable_cancel_button: bool = False,
- warning_message: str | None = None,
Inherited args from the base class.
- Keyword Arguments:
width (int) – Window width. Default 400.
title (str) – Title to display. Default None.
ok_handler (Callable) – Function to invoke when Ok button clicked. Function signature: void okay_handler(dialog: PopupDialog)
cancel_handler (Callable) – Function to invoke when Cancel button clicked. Function signature: void cancel_handler(dialog: PopupDialog)
ok_label (str) – Alternative text to display on ‘Accept’ button. Default ‘Ok’.
cancel_label (str) – Alternative text to display on ‘Cancel’ button. Default ‘Cancel’.
warning_message (Optional[str]) – Warning message that will displayed in red with the warning glyph. Default None.
parent (omni.ui.Widget) – OBSOLETE.
- destroy()#
Destructor
- set_message(message: str)#
Updates the message string.
- Parameters:
message (str) – The message string.