summaryrefslogtreecommitdiffstats
path: root/examples/url_handler
diff options
context:
space:
mode:
authorLibravatar Richard <richardsoncusto@gmail.com>2021-06-09 15:00:01 -0300
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-06-25 14:14:03 +0200
commit96a462d2f2cb608ad14c93cc55896108a2dccb2b (patch)
treecc87dea4b01aa89170f672668a051fb78cb9528a /examples/url_handler
parent9ae22b58d843d9a39212028478598c19a49bc2e6 (diff)
downloadiced-96a462d2f2cb608ad14c93cc55896108a2dccb2b.tar.gz
iced-96a462d2f2cb608ad14c93cc55896108a2dccb2b.tar.bz2
iced-96a462d2f2cb608ad14c93cc55896108a2dccb2b.zip
Use new enum variant and new winit repo
Diffstat (limited to 'examples/url_handler')
-rw-r--r--examples/url_handler/Cargo.toml4
-rw-r--r--examples/url_handler/src/main.rs18
2 files changed, 13 insertions, 9 deletions
diff --git a/examples/url_handler/Cargo.toml b/examples/url_handler/Cargo.toml
index 595bdac0..911b2f25 100644
--- a/examples/url_handler/Cargo.toml
+++ b/examples/url_handler/Cargo.toml
@@ -7,6 +7,4 @@ publish = false
[dependencies]
iced = { path = "../.." }
-iced_native = { path = "../../native" }
-syslog="4.0"
-log="0.4" \ No newline at end of file
+iced_native = { path = "../../native" } \ No newline at end of file
diff --git a/examples/url_handler/src/main.rs b/examples/url_handler/src/main.rs
index 56d81031..f14e5227 100644
--- a/examples/url_handler/src/main.rs
+++ b/examples/url_handler/src/main.rs
@@ -1,8 +1,11 @@
use iced::{
- executor, Application, Command, Clipboard,
- Container, Element, Length, Settings, Subscription, Text,
+ executor, Application, Clipboard, Command, Container, Element, Length,
+ Settings, Subscription, Text,
+};
+use iced_native::{
+ event::{MacOS, PlatformSpecific},
+ Event,
};
-use iced_native::Event;
pub fn main() -> iced::Result {
App::run(Settings::default())
@@ -38,7 +41,10 @@ impl Application for App {
) -> Command<Message> {
match message {
Message::EventOccurred(event) => {
- if let Event::UrlReceived(url) = event{
+ if let Event::PlatformSpecific(PlatformSpecific::MacOS(
+ MacOS::ReceivedUrl(url),
+ )) = event
+ {
self.url = Some(url);
}
}
@@ -52,9 +58,9 @@ impl Application for App {
}
fn view(&mut self) -> Element<Message> {
- let content = match &self.url{
+ let content = match &self.url {
Some(url) => Text::new(format!("{}", url)),
- None => Text::new("No URL received yet!")
+ None => Text::new("No URL received yet!"),
};
Container::new(content.size(48))