gyscos / gyscos/cursive

[Possible bug] Builder example isn't working

Open
#747 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
4.8k
Forks
270
Avg merge
5d 19h
Merged PRs (30d)
2

Description

**Describe the bug**
The "builder" example in the examples dir isn't working - the program panics.

**To Reproduce**
It seems the `builder` feature is not released :) but I was trying that out. I set the version to this git repo in toml and added "builder" feature. Then I copied `builder.rs` and all the associated yaml files and then ran the program. The program panicked with the following error:

```
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: RecipeFailed("Dialog", ResolveFailed { var_failure: InvalidConfig { message: "Expected variable as key", config: Object {"LinearLayout": Object {"children": Array [Object {"TextView": String("Fancy prompt")}, String("DummyView"), Object {"Titled": Object {"child": Object {"LabeledField": Object {"label": String("Please write:"), "name": String("edit"), "on_edit": String("$on_edit")}}, "title": String("Edit area")}}, Object {"Button": Object {"callback": String("$randomize"), "label": String("Randomize")}}, Object {"VSpace": Number(2)}, Object {"TextView": Object {"with": Array [Object {"name": String("status")}]}}], "with": Array [Object {"padding": Number(1)}, String("full_width"), Object {"fixed_height": Number(11)}]}} }, config_failure: RecipeFailed("LinearLayout", ResolveFailed { var_failure: InvalidConfig { message: "Expected variable as key", config: Object {"Titled": Object {"child": Object {"LabeledField": Object {"label": String("Please write:"), "name": String("edit"), "on_edit": String("$on_edit")}}, "title": String("Edit area")}} }, config_failure: RecipeNotFound("Titled") }) })', app/src/main.rs:74:32
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```

I understand if this feature is not ready, as it's not documented anywhere and the builder feature is not published (hence pointing to github in toml). :)

**Expected behavior**
I was hoping the example will work. I like the idea of composing UI in a declarative way.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Environment**
* latest version of MacOS
* Backend used: ncurses
* Current locale (run `locale` in a terminal)
* Cursive version (from crates.io, from git, ...)

**Additional context**
Add any other context about the problem here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.