bootstack.confirm#
- bootstack.confirm(message, *, title='', confirm_text='Yes', cancel_text='No', confirm_role='primary', severity=None, icon=None, sound=None, parent=None)#
Show a confirmation dialog.
- Parameters:
message (str) – The question text to display.
title (str) – Dialog window title.
confirm_text (str) – Label for the confirm button. Defaults to
'Yes'.cancel_text (str) – Label for the cancel button. Defaults to
'No'.confirm_role (Literal['primary', 'secondary', 'danger', 'cancel']) – Button role controlling styling. Use
'danger'for destructive actions,'primary'(default) for standard confirmations. When'danger', the confirm button is not focused by default so Enter does not accidentally trigger it. Automatically overridden to'danger'whenseverity='danger'and to warning styling whenseverity='warning', unless set explicitly.severity (SeverityToken | None) – Visual severity level — sets a colored icon, adjusts the confirm button color for
'danger'and'warning', and controls the default sound behavior.icon (str | None) – Icon name override. Takes precedence over
severity.sound (bool | None) – Override the alert sound.
Truealways rings the bell,Falsealways suppresses it.None(default) defers toseverity: rings for'warning'and'danger', silent otherwise.parent (Any) – Parent widget. Defaults to the active root window.
- Returns:
Trueif the user clicked the confirm button,Falseotherwise.- Return type: