bootstack.dialogs.FilterDialog#

class bootstack.dialogs.FilterDialog(*, title='', items=None, enable_search=False, enable_select_all=False, parent=None)#

Bases: object

A dialog for selecting multiple items from a list.

Displays a scrollable list of checkboxes. Optionally includes a search box that narrows visible items and a “Select All” checkbox.

Parameters:
  • title (str) – Dialog window title.

  • items (list[str | dict[str, Any]] | None) –

    Items to display. Each item is a string or a dict with keys:

    • text (str): Display label (required for dicts).

    • value (Any): Value returned when selected. Defaults to text.

    • selected (bool): Initial check state. Defaults to False.

  • enable_search (bool) – Include a search box that filters items by text. Defaults to False.

  • enable_select_all (bool) – Include a “Select All” checkbox. Defaults to False.

  • parent (Any) – Parent widget. Defaults to the active root window.

property result: list[Any] | None#

List of selected values after closing, or None if canceled.

show(*, position=None, modal=None)#

Display the dialog and block until it is closed.

Parameters:
  • position (tuple[int, int] | None) – Explicit (x, y) screen coordinates for the dialog. Defaults to centered on the parent window.

  • modal (bool | None) – Override the default modality. True blocks the parent; False shows a non-blocking dialog.

Returns:

self — allows chaining – dlg = FilterDialog(...).show(); dlg.result.

Return type:

FilterDialog