Skip to content

Commit

Permalink
Add .run()
Browse files Browse the repository at this point in the history
  • Loading branch information
wtholliday committed Dec 23, 2023
1 parent 28b1783 commit 4f67ce9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 3 additions & 2 deletions examples/gallery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ fn text_editor_example() -> impl View {
}

fn main() {
rui(vstack((
vstack((
"rui widget gallery".padding(10.0),
button_example(),
slider_example(),
Expand All @@ -49,5 +49,6 @@ fn main() {
text_editor_example(),
))
.padding(Auto)
.window_title("rui widget gallery"))
.window_title("rui widget gallery")
.run()
}
8 changes: 8 additions & 0 deletions src/winit_event_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -588,3 +588,11 @@ pub fn parse_url_query_string<'a>(query: &'a str, search_key: &str) -> Option<&'

None
}

pub trait Run: View + Sized {
fn run(self) {
rui(self)
}
}

impl<V: View> Run for V {}

0 comments on commit 4f67ce9

Please sign in to comment.