-
Notifications
You must be signed in to change notification settings - Fork 115
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
Write Xilem documentation #392
Comments
+1 |
If someone wants to teach me:
I'll write them up. I don't even know rust yet (aside from very trivial syntax), so you'd get the view from someone very attentive to assumptions. |
Thank you for your offer. Some starting points. Basic usage patterns
How to create your first appYou'd add a dependency to Xilem (probably on the main branch), then set up your app: fn app_logic(data: &mut i32) -> impl WidgetView<i32> {
flex((label(format!("{data}")), button("increment", |data: &mut i32| data+=1)))
}
fn main() -> Result<(), EventLoopError> {
let app = Xilem::new(0, app_logic);
app.run_windowed(EventLoop::with_user_event(), "Centered Flex".into())?;
Ok(())
} A slightly more advanced pattern would use a custom struct in place of the i32, there. |
how open new window ?, and add menus |
Xilem and Masonry currently only support a single window. To open that window, you should see our examples. Feel free to open a Zulip discussion around menus so we can mentor your implementation of them |
Xilem's lack of documentation is one of the problems new users complain about the most often. We need to avoid staying in that state for too long.
We should at least document:
The text was updated successfully, but these errors were encountered: