pub fn handle_output(&self, output: egui::PlatformOutput) -> Result<sdl2::mouse::Cursor> {
        let system_cursor = egui_to_sdl2_cursor(output.cursor_icon);
        let cursor = sdl2::mouse::Cursor::from_system(system_cursor).map_err(|e| anyhow!(e))?;

        if !output.copied_text.is_empty() {
            use clipboard::{ClipboardContext, ClipboardProvider};
            let mut ctx: ClipboardContext =
                ClipboardProvider::new().map_err(|_| anyhow!("Could not open clipboard."))?;
            ctx.set_contents(output.copied_text)
                .map_err(|_| anyhow!("Could not set clipboard text."))?;
        }

        if let Some(url) = output.open_url {
            if let Err(e) = webbrowser::open(&url.url) {
                eprintln!("Error opening link: {}", e);
            }
        }

        Ok(cursor)
    }
/// Handles [egui] output such as changing cursor icon, clipboard actions or opening a link.
Handles [egui] output such as changing cursor icon, clipboard actions or opening a link.
Handles [ egui ] output such as changing cursor icon clipboard actions or opening a link .
pub fn handle_output(&self, output: egui::PlatformOutput) -> Result<sdl2::mouse::Cursor> {
        let system_cursor = egui_to_sdl2_cursor(output.cursor_icon);
        let cursor = sdl2::mouse::Cursor::from_system(system_cursor).map_err(|e| anyhow!(e))?;
        if !output.copied_text.is_empty() {
            use clipboard::{ClipboardContext, ClipboardProvider};
            let mut ctx: ClipboardContext =
                ClipboardProvider::new().map_err(|_| anyhow!("Could not open clipboard."))?;
            ctx.set_contents(output.copied_text)
                .map_err(|_| anyhow!("Could not set clipboard text."))?;
        }
        if let Some(url) = output.open_url {
            if let Err(e) = webbrowser::open(&url.url) {
                eprintln!("Error opening link: {}", e);
            }
        }
        Ok(cursor)
    }
pub fn handle_output ( & self , output : egui :: PlatformOutput ) -> Result < sdl2 :: mouse :: Cursor > { let system_cursor = egui_to_sdl2_cursor ( output . cursor_icon ) ; let cursor = sdl2 :: mouse :: Cursor :: from_system ( system_cursor ) . map_err ( | e | anyhow ! ( e ) ) ? ; if ! output . copied_text . is_empty ( ) { use clipboard :: { ClipboardContext , ClipboardProvider } ; let mut ctx : ClipboardContext = ClipboardProvider :: new ( ) . map_err ( | _ | anyhow ! ( " " ) ) ? ; ctx . set_contents ( output . copied_text ) . map_err ( | _ | anyhow ! ( " " ) ) ? ; } if let Some ( url ) = output . open_url { if let Err ( e ) = webbrowser :: open ( & url . url ) { eprintln ! ( " " e ) ; } } Ok ( cursor ) }
Handles [egui] output such as changing cursor icon, clipboard actions or opening a link.
Handles [ egui ] output such as changing cursor icon clipboard actions or opening a link .
&self
output
egui::PlatformOutput
&self
output
egui::PlatformOutput