Skip to content

[Question] How to build a tree from bottom up ? #3

Open
@kivimango

Description

@kivimango

Hello ! i stuck with a problem: i cant build a tree from bottom up.
Consider the following scenario: (i would like to store GUI widgets parent-children relationships using this lib)

Window()::new()
    .child(
            Center::new(
                .child(
                    Text::new("Sample text").build()
                )
                .child(
                    Text::new("Sample text 2").build()
                )
                .build()
     .build()

My problem is to append children to their parent in the build() method, i need the parent's index.But the parent is not built yet, hence its index is not exists.
How to solve this problem ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions