Skip to content

hkb_editor.gui.dialogs.edit_simple_array_dialog

edit_simple_array_dialog

Bases: DpgItem

A table editor for a list of same-shaped tuples.

Rows can be added, removed and reordered, and every cell gets an input widget matching its column type. The on_* hooks may veto a change by raising.

Parameters:

Name Type Description Default
items list of tuple

The list to edit; mutated in place.

required
columns dict

Maps column name to the type of its value.

required
title str

Window title bar label.

'Edit Array'
help str

Explanation shown at the bottom of the dialog.

None
choices dict

Maps column index to a list of choices for that column.

None
on_add callable

on_add(index, new_value); may edit new_value or raise to veto.

None
on_update callable

on_update(index, old_item, new_item); may return a replacement item or raise to veto.

None
on_delete callable

on_delete(index); may raise to veto.

None
on_move callable

on_move(index, new_index); may raise to veto.

None
on_close callable

Called as callback(tag, items, user_data) when the dialog closes.

None
get_item_hint callable

Enables a per-row '(?)' button. Not implemented yet.

None
item_limit int

Max rows to render; derived from the column count if omitted.

None
tag int or str

Explicit tag; auto-generated if 0.

0
user_data any

Passed through to on_close.

None

fill_table

fill_table(
    sender: str = None,
    filt: str = None,
    user_data: Any = None,
) -> None

Rebuild the table from the current items and filter.

Ko-fi donations