summaryrefslogtreecommitdiffstats
path: root/examples/events
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector@hecrj.dev>2023-12-05 01:03:09 +0100
committerLibravatar GitHub <noreply@github.com>2023-12-05 01:03:09 +0100
commitfc285d3e461626408c56bbc1605fcf0c974b2f69 (patch)
tree8aca292516d9aa43b78a14f51dd90caf60c691d7 /examples/events
parent8727b3fc50ec251d9c117c51ca1289be5ba9b117 (diff)
parent5c5e7653bed248ba63faa6563e4d673e4441415e (diff)
downloadiced-fc285d3e461626408c56bbc1605fcf0c974b2f69.tar.gz
iced-fc285d3e461626408c56bbc1605fcf0c974b2f69.tar.bz2
iced-fc285d3e461626408c56bbc1605fcf0c974b2f69.zip
Merge pull request #1964 from bungoboingo/feat/multi-window-support
[Feature] 🪟 Multi Window 🪟 .. redux!
Diffstat (limited to 'examples/events')
-rw-r--r--examples/events/src/main.rs12
1 files changed, 8 insertions, 4 deletions
diff --git a/examples/events/src/main.rs b/examples/events/src/main.rs
index 32d0da2c..334b012d 100644
--- a/examples/events/src/main.rs
+++ b/examples/events/src/main.rs
@@ -10,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()
})
}
@@ -54,8 +57,9 @@ impl Application for Events {
Command::none()
}
Message::EventOccurred(event) => {
- if let Event::Window(window::Event::CloseRequested) = event {
- window::close()
+ if let Event::Window(id, window::Event::CloseRequested) = event
+ {
+ window::close(id)
} else {
Command::none()
}
@@ -65,7 +69,7 @@ impl Application for Events {
Command::none()
}
- Message::Exit => window::close(),
+ Message::Exit => window::close(window::Id::MAIN),
}
}