summaryrefslogtreecommitdiffstats
path: root/examples/events
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2023-11-29 22:28:31 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2023-11-29 22:28:31 +0100
commite09b4e24dda51b8212d8ece52431dacaa3922a7b (patch)
tree7005e181528134ebdde5bbbe5909273db9f30174 /examples/events
parent83c7870c569a2976923ee6243a19813094d44673 (diff)
parent7f8b17604a31e00becc43130ec516c1a53552c88 (diff)
downloadiced-e09b4e24dda51b8212d8ece52431dacaa3922a7b.tar.gz
iced-e09b4e24dda51b8212d8ece52431dacaa3922a7b.tar.bz2
iced-e09b4e24dda51b8212d8ece52431dacaa3922a7b.zip
Merge branch 'master' into feat/multi-window-support
Diffstat (limited to 'examples/events')
-rw-r--r--examples/events/Cargo.toml3
-rw-r--r--examples/events/README.md6
-rw-r--r--examples/events/src/main.rs10
3 files changed, 8 insertions, 11 deletions
diff --git a/examples/events/Cargo.toml b/examples/events/Cargo.toml
index 15ffc0af..87315a10 100644
--- a/examples/events/Cargo.toml
+++ b/examples/events/Cargo.toml
@@ -6,4 +6,5 @@ edition = "2021"
publish = false
[dependencies]
-iced = { path = "../..", features = ["debug"] }
+iced.workspace = true
+iced.features = ["debug"]
diff --git a/examples/events/README.md b/examples/events/README.md
index 3c9a1cab..fd7f9b47 100644
--- a/examples/events/README.md
+++ b/examples/events/README.md
@@ -4,12 +4,6 @@ A log of native events displayed using a conditional `Subscription`.
The __[`main`]__ file contains all the code of the example.
-<div align="center">
- <a href="https://gfycat.com/infamousicyermine">
- <img src="https://thumbs.gfycat.com/InfamousIcyErmine-small.gif">
- </a>
-</div>
-
You can run it with `cargo run`:
```
cargo run --package events
diff --git a/examples/events/src/main.rs b/examples/events/src/main.rs
index c3ac6fd1..334b012d 100644
--- a/examples/events/src/main.rs
+++ b/examples/events/src/main.rs
@@ -1,9 +1,8 @@
use iced::alignment;
+use iced::event::{self, Event};
use iced::executor;
-use iced::subscription;
use iced::widget::{button, checkbox, container, text, Column};
use iced::window;
-use iced::Event;
use iced::{
Alignment, Application, Command, Element, Length, Settings, Subscription,
Theme,
@@ -11,7 +10,10 @@ use iced::{
pub fn main() -> iced::Result {
Events::run(Settings {
- exit_on_close_request: false,
+ window: window::Settings {
+ exit_on_close_request: false,
+ ..window::Settings::default()
+ },
..Settings::default()
})
}
@@ -72,7 +74,7 @@ impl Application for Events {
}
fn subscription(&self) -> Subscription<Message> {
- subscription::events().map(Message::EventOccurred)
+ event::listen().map(Message::EventOccurred)
}
fn view(&self) -> Element<Message> {