// This is joke program // I don't think you should give this program to your friends. use rsgt::event::WindowListener; use rsgt::msgbox::{MsgBox, BS_OK, MS_ERROR, MS_INFORMATION}; use rsgt::rframe::{RFrame, RFrameBuilder}; use rsgt::Size; use std::path::PathBuf; fn main() { rsgt::os::enable_visual_style(); let mut frame = RFrameBuilder::new() .with_size(Size(700, 700)) .with_title("File drop prohibited area") .with_visible(true) .build() .unwrap(); frame.add_window_listener(SampleWindowListener {}); frame.run(); } struct SampleWindowListener {} impl WindowListener for SampleWindowListener { fn window_opened(&self, frame: &RFrame) { MsgBox::new( "No file drops are allowed here. Do not drop files by mistake!", "Information", MS_ERROR, BS_OK, ) .run(); } fn window_dropped_file(&self, _path: PathBuf, frame: &RFrame) { MsgBox::new(format!("No file drops are allowed here. Files will be deleted as punishment.\nDelete file: {}",_path.to_str().unwrap()),"You have made a grave mistake. 😂😭🥺🤮😵💩",MS_ERROR,BS_OK).run(); match std::fs::remove_file(_path.to_str().unwrap()) { Ok(_) => { MsgBox::new( "Be careful from now on!", "File deletion is complete. 😋", MS_INFORMATION, BS_OK, ) .run(); } Err(_) => { MsgBox::new( "You took steps to prevent it from being deleted, didn't you?", "File deletion failed. 🤮", MS_INFORMATION, BS_OK, ) .run(); } } } }