diff options
author | 2024-02-07 09:47:15 +0100 | |
---|---|---|
committer | 2024-02-07 09:47:15 +0100 | |
commit | f18a81451fffa2ead0eb6be72f9a32f5f683a016 (patch) | |
tree | 77fde588e636b1b1de78b466b85ac5d203808a56 /runtime/src/window.rs | |
parent | 7105992228e58566cfacb6a1d6e10ec60fb05ecf (diff) | |
download | iced-f18a81451fffa2ead0eb6be72f9a32f5f683a016.tar.gz iced-f18a81451fffa2ead0eb6be72f9a32f5f683a016.tar.bz2 iced-f18a81451fffa2ead0eb6be72f9a32f5f683a016.zip |
Rename `fetch_native_handle` to `run_with_handle` in `window`
Diffstat (limited to 'runtime/src/window.rs')
-rw-r--r-- | runtime/src/window.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/runtime/src/window.rs b/runtime/src/window.rs index cf47347a..4d97d5ee 100644 --- a/runtime/src/window.rs +++ b/runtime/src/window.rs @@ -15,6 +15,8 @@ use crate::core::{Point, Size}; use crate::futures::event; use crate::futures::Subscription; +pub use raw_window_handle; + use raw_window_handle::WindowHandle; /// Subscribes to the frames of the window of the running application. @@ -172,14 +174,14 @@ pub fn change_icon<Message>(id: Id, icon: Icon) -> Command<Message> { Command::single(command::Action::Window(Action::ChangeIcon(id, icon))) } -/// Requests access to the native window handle for the window with the given id. +/// Runs the given callback with the native window handle for the window with the given id. /// /// Note that if the window closes before this call is processed the callback will not be run. -pub fn fetch_native_handle<Message>( +pub fn run_with_handle<Message>( id: Id, f: impl FnOnce(&WindowHandle<'_>) -> Message + 'static, ) -> Command<Message> { - Command::single(command::Action::Window(Action::FetchNativeHandle( + Command::single(command::Action::Window(Action::RunWithHandle( id, Box::new(f), ))) |