summaryrefslogtreecommitdiffstats
path: root/src/application.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/application.rs')
-rw-r--r--src/application.rs18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/application.rs b/src/application.rs
index 5ecb901e..d761c990 100644
--- a/src/application.rs
+++ b/src/application.rs
@@ -140,7 +140,7 @@ pub trait Application: Sized {
<Instance<Self> as iced_winit::Application>::run();
#[cfg(target_arch = "wasm32")]
- iced_web::Application::run(Instance(self));
+ <Instance<Self> as iced_web::Application>::run();
}
}
@@ -180,11 +180,21 @@ where
{
type Message = A::Message;
- fn update(&mut self, message: Self::Message) {
- self.0.update(message);
+ fn new() -> (Self, Command<A::Message>) {
+ let (app, command) = A::new();
+
+ (Instance(app), command)
}
- fn view(&mut self) -> Element<Self::Message> {
+ fn title(&self) -> String {
+ self.0.title()
+ }
+
+ fn update(&mut self, message: Self::Message) -> Command<Self::Message> {
+ self.0.update(message)
+ }
+
+ fn view(&mut self) -> Element<'_, Self::Message> {
self.0.view()
}
}