Skip to content

Creating controls is unsound #54

Open
@NoraCodes

Description

@NoraCodes

Creating controls is unsound at the moment. libui enforces a tree structure. We should enforce it in the API.

I would like to do this by creating a trait which permits adding a control, and implementing it on all containers (like windows and grids and boxes).

The question is, should we have individual methods for each control:

let btn: &mut Button = window.add_button("Button text!");

or should we have an enum with all the controls?

let btn: &mut Button = window.add(Controls::Button("Button text!"));

Metadata

Metadata

Assignees

No one assigned

    Labels

    c-bugBug - some feature is not working as expectedp-highHigh Priority

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions