pub fn add_icon_from_filename(&self, filename: &str) -> Result<i32, NwgError> {
        if self.handle.is_null() { panic!("{}", NOT_BOUND); }

        let (w, h) = self.size();
        let mut icon = Icon::default();
        Icon::builder()
            .source_file(Some(filename))
            .size(Some((w as u32, h as u32)))
            .strict(true)
            .build(&mut icon)?;

        Ok(self.add_icon(&icon))
    }
/**
        Adds a icon directly from a filename. The image is resized to the image list size.
        Returns the index to the image or an error if the image could not be loaded
    */
Adds a icon directly from a filename. The image is resized to the image list size.
Returns the index to the image or an error if the image could not be loaded
Adds a icon directly from a filename . The image is resized to the image list size . Returns the index to the image or an error if the image could not be loaded
pub fn add_icon_from_filename(&self, filename: &str) -> Result<i32, NwgError> {
        if self.handle.is_null() { panic!("{}", NOT_BOUND); }
        let (w, h) = self.size();
        let mut icon = Icon::default();
        Icon::builder()
            .source_file(Some(filename))
            .size(Some((w as u32, h as u32)))
            .strict(true)
            .build(&mut icon)?;
        Ok(self.add_icon(&icon))
    }
pub fn add_icon_from_filename ( & self , filename : & str ) -> Result < i32 , NwgError > { if self . handle . is_null ( ) { panic ! ( " " NOT_BOUND ) ; } let ( w , h ) = self . size ( ) ; let mut icon = Icon :: default ( ) ; Icon :: builder ( ) . source_file ( Some ( filename ) ) . size ( Some ( ( w as u32 , h as u32 ) ) ) . strict ( true ) . build ( & mut icon ) ? ; Ok ( self . add_icon ( & icon ) ) }
Adds a icon directly from a filename.
Adds a icon directly from a filename .
&self
filename
&str