Skip to content

hkb_editor.gui.dialogs.create_object_dialog

create_object_dialog

Bases: DpgItem

Create a new record of a chosen type and fill in its attributes.

The record is created as soon as a type is picked so the attribute widgets can edit it directly; it is only added to the tagfile on confirm.

Parameters:

Name Type Description Default
tagfile Tagfile

Tagfile the object will be added to.

required
alias_manager AliasManager

Passed on to the embedded attributes widget.

required
callback callable

Called as callback(tag, record, user_data) on confirm.

required
allowed_types iterable of str

Restrict the type choice; names or typeNNN IDs. Renders a combo instead of the type search dialog.

None
include_derived_types bool

Also offer subtypes of allowed_types.

False
selected_type_id str

Pre-select this type.

None
id_required bool

Refuse to create the object without an explicit object ID.

False
title str

Window title bar label.

'Create Hkb Object'
tag int or str

Explicit tag; auto-generated if None.

None
user_data any

Passed through to callback.

None

pin_objects property

pin_objects: bool

Whether the caller should pin the created object.

record property

record: HkbRecord

The record being edited, or None while no type is selected.

set_object_type

set_object_type(new_type_id: str) -> None

Switch to a new record type, discarding the current attributes.

show_message

show_message(
    msg: str = None, color: RGBA = style.red
) -> None

Show or hide the notification label. Pass msg=None to hide.

Ko-fi donations