diff --git a/examples/gallery.rs b/examples/gallery.rs index 5da57b1..e42308e 100644 --- a/examples/gallery.rs +++ b/examples/gallery.rs @@ -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(), @@ -49,5 +49,6 @@ fn main() { text_editor_example(), )) .padding(Auto) - .window_title("rui widget gallery")) + .window_title("rui widget gallery") + .run() } diff --git a/src/winit_event_loop.rs b/src/winit_event_loop.rs index 76a048d..db0beb9 100644 --- a/src/winit_event_loop.rs +++ b/src/winit_event_loop.rs @@ -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 Run for V {} \ No newline at end of file