bootstack.dialogs.FormDialog#
- class bootstack.dialogs.FormDialog(*, title='Form', data=None, items=None, col_count=1, min_col_width=None, on_data_change=None, on_close=None, width=None, height=None, buttons=None, min_size=None, max_size=None, resizable=False, parent=None)#
Bases:
objectA dialog window that embeds a Form for structured data entry.
- Parameters:
title (str) – Dialog window title.
data (dict[str, Any] | None) – Initial data backing the form. Keys become field names.
items (Sequence[Any] | None) – Explicit form layout —
FormItem/GroupItem/TabsIteminstances or equivalent dicts. If omitted, fields are inferred fromdata.col_count (int) – Number of form columns. Default
1.min_col_width (int | None) – Minimum column width in pixels.
on_data_change (Callable[[dict[str, Any]], Any] | None) – Callback invoked on every field change, receiving the current data dict.
on_close (Callable[[], Any] | None) – Callback fired when the dialog closes by any means.
width (int | None) – Explicit form width in pixels.
height (int | None) – Explicit form height in pixels.
buttons (Iterable[ButtonSpec | str] | None) – Footer button specs. Defaults to Cancel + OK.
min_size (tuple[int, int] | None) – Minimum dialog window size
(width, height).max_size (tuple[int, int] | None) – Maximum dialog window size
(width, height).resizable (tuple[bool, bool] | bool) – Allow window resizing. Default
False.parent (Any) – Parent widget. Defaults to the active root window.
- show(*, position=None, modal=None)#
Display the dialog and block until it is closed.
- Parameters:
- Returns:
self— allows chaining –dlg = FormDialog(...).show(); dlg.result.- Return type: