Closed AlexEne closed 3 years ago
For reference, I'm trying to re-create this window layout in thyme:
You should be able to just insert
use thyme::{Align, Layout};
before that and it should work. You shouldn't have any issue recreating that layout with Thyme either in the code or using the YAML attributes.
The problem is that this line ui.child("custom_widget")
returns WidgetState
and that's an enum that doesn't have align
or the other methods available.
It may seem that the intent was that add_child
should return a Widget
?
Ah! Sorry about that, you should replace ui.child(
with ui.start(
the child
method is a shorthand that immediately finishes building the widget without any extra behavior. I'd recommend you check out the demo example.
Oh, ok I can raise a PR to fix the example and maybe enable doc tests.
Fixed in 366ddbe28b39cab74cf7d7fd31f599ba6ea2450e
The code here: https://docs.rs/thyme/0.5.0/thyme/ mentions:
This errors out as align is not found in
WidgetState