Exemplo n.º 1
0
def construct_ui(u: Declarative.DeclarativeUI) -> Declarative.UIDescription:
    title_field = u.create_line_edit(text="@binding(title_model.value)")
    add_button = u.create_push_button(text="Add", on_clicked="add_mode")
    modes_menu = u.create_combo_box(name="modes_menu", items_ref="@binding(mode_titles_model.value)", current_index="@binding(model.mode_index)")
    modes_stack = u.create_stack(items="model.modes", item_component_id="mode", current_index="@binding(model.mode_index)")
    modes_group = u.create_group(modes_stack)
    return u.create_column(title_field, add_button, modes_menu, modes_group, spacing=8, margin=12)
Exemplo n.º 2
0
def construct_ui(ui: Declarative.DeclarativeUI) -> Declarative.UIDescription:

    stack0 = ui.create_column(ui.create_label(text="111"), ui.create_label(text="ONE"))
    stack1 = ui.create_column(ui.create_label(text="222"), ui.create_label(text="TWO"))
    stack2 = ui.create_column(ui.create_label(text="333"), ui.create_label(text="THREE"))

    stack = ui.create_stack(stack0, stack1, stack2, current_index="@binding(stack_index_model.value)")

    chooser = ui.create_combo_box(items=["One", "Two", "Three"], current_index="@binding(stack_index_model.value)")

    return ui.create_column(stack, chooser, spacing=8)