diff options
| author | 2022-02-05 06:55:22 -0500 | |
|---|---|---|
| committer | 2022-02-05 06:55:22 -0500 | |
| commit | 2e8fb095686c3ebaf83e61fe8ff222b91f25bfb4 (patch) | |
| tree | 4df3a4b2358b186d78c6fbe1f2309841f9d8e83d | |
| parent | c15701581e52ae838f8e7153ae7e639dd86b1ef6 (diff) | |
| download | iced-2e8fb095686c3ebaf83e61fe8ff222b91f25bfb4.tar.gz iced-2e8fb095686c3ebaf83e61fe8ff222b91f25bfb4.tar.bz2 iced-2e8fb095686c3ebaf83e61fe8ff222b91f25bfb4.zip | |
Allow the creation of a clipboard without a window.
| -rw-r--r-- | winit/src/clipboard.rs | 8 | 
1 files changed, 8 insertions, 0 deletions
| diff --git a/winit/src/clipboard.rs b/winit/src/clipboard.rs index 1b92b28d..c1fd8813 100644 --- a/winit/src/clipboard.rs +++ b/winit/src/clipboard.rs @@ -26,6 +26,14 @@ impl Clipboard {          Clipboard { state }      } +    /// Creates a new [`Clipboard`] that isn't associated with a window. +    /// This clipboard will never contain a copied value. +    pub fn unconnected() -> Clipboard { +        Clipboard { +            state: State::Unavailable, +        } +    } +      /// Reads the current content of the [`Clipboard`] as text.      pub fn read(&self) -> Option<String> {          match &self.state { | 
