summaryrefslogtreecommitdiffstats
path: root/examples/toast
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-09-07 02:45:15 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-09-07 02:45:15 +0200
commit08a031cbe5913c249efa7fc82556d5d95f981c4c (patch)
tree8b8db2279c04393a8b8e39ed0a74b922c91c8dea /examples/toast
parenta56b25b9096d47ada3c4349f5b91110dfaa92bf6 (diff)
downloadiced-08a031cbe5913c249efa7fc82556d5d95f981c4c.tar.gz
iced-08a031cbe5913c249efa7fc82556d5d95f981c4c.tar.bz2
iced-08a031cbe5913c249efa7fc82556d5d95f981c4c.zip
Introduce `keyboard::on_key_press` and `on_key_release`
Also rename `subscription::events*` to `event::listen*`.
Diffstat (limited to 'examples/toast')
-rw-r--r--examples/toast/src/main.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/examples/toast/src/main.rs b/examples/toast/src/main.rs
index 42f6c348..47b272a9 100644
--- a/examples/toast/src/main.rs
+++ b/examples/toast/src/main.rs
@@ -1,10 +1,12 @@
+use iced::event::{self, Event};
use iced::executor;
use iced::keyboard;
-use iced::subscription::{self, Subscription};
use iced::widget::{
self, button, column, container, pick_list, row, slider, text, text_input,
};
-use iced::{Alignment, Application, Command, Element, Event, Length, Settings};
+use iced::{
+ Alignment, Application, Command, Element, Length, Settings, Subscription,
+};
use toast::{Status, Toast};
@@ -57,7 +59,7 @@ impl Application for App {
}
fn subscription(&self) -> Subscription<Self::Message> {
- subscription::events().map(Message::Event)
+ event::listen().map(Message::Event)
}
fn update(&mut self, message: Message) -> Command<Message> {