Re-implement against latest iced master. Rename FetchNativeHandle.
This commit is contained in:
parent
6f97b62457
commit
7105992228
5 changed files with 47 additions and 0 deletions
|
|
@ -15,6 +15,8 @@ use crate::core::{Point, Size};
|
|||
use crate::futures::event;
|
||||
use crate::futures::Subscription;
|
||||
|
||||
use raw_window_handle::WindowHandle;
|
||||
|
||||
/// Subscribes to the frames of the window of the running application.
|
||||
///
|
||||
/// The resulting [`Subscription`] will produce items at a rate equal to the
|
||||
|
|
@ -170,6 +172,19 @@ 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.
|
||||
///
|
||||
/// Note that if the window closes before this call is processed the callback will not be run.
|
||||
pub fn fetch_native_handle<Message>(
|
||||
id: Id,
|
||||
f: impl FnOnce(&WindowHandle<'_>) -> Message + 'static,
|
||||
) -> Command<Message> {
|
||||
Command::single(command::Action::Window(Action::FetchNativeHandle(
|
||||
id,
|
||||
Box::new(f),
|
||||
)))
|
||||
}
|
||||
|
||||
/// Captures a [`Screenshot`] from the window.
|
||||
pub fn screenshot<Message>(
|
||||
id: Id,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue