-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pile failing to render anything at all. #231
Comments
in |
So it seems to be something to do with when the This example demonstrates that when there is no reference to the handle, the pile doesn't render the first (and only) widget in the pile, note that the button handler is commented out, and thus #[cushy::main]
fn main(app: &mut App) -> cushy::Result {
let pending = PendingWindow::default();
let pile = Pile::default();
let handle = pile.push("show a pile 1!".to_label());
handle.show(false);
let show_first_button = format!("show first")
.into_button()
//.on_click({
// let section = handle.clone();
// move |_| section.show(true)
//})
.make_widget();
println!("pile: {:?}", pile);
let ui = pending.with_root(
show_first_button
.and(pile.centered().expand())
.into_rows()
.expand()
);
ui.open_centered(app)?;
Ok(())
} here's a callstack showing that however, if you restore the commented-out code, as follows, then it works: ...
let show_first_button = format!("show first")
.into_button()
.on_click({
let section = handle.clone();
move |_| section.show(true)
})
.make_widget();
... and here is a screenshot of the callstack showing that I'm guessing this isn't intended and/or needs to be documented. I had to go down the rabbit-hole pretty far to figure this out and we probably don't want other users of |
this seems to be stemming from the It also feels like |
This minimal example works:
Source: https://github.com/hydra/cushy/blob/pile_fail_1/examples/pile.rs
Screenshot:
This example does not render the pile:
Source: https://github.com/hydra/cushy/blob/pile_fail_1/examples/pile_fail_1.rs
Screenshot:
The only difference seems to be how the window is created.
This is blocking me from using
Pile
in my application.The text was updated successfully, but these errors were encountered: