Last active
August 25, 2025 20:59
-
-
Save MoAlyousef/fbfb6570880164fe20c4ee8b0d4a8cca to your computer and use it in GitHub Desktop.
Revisions
-
MoAlyousef revised this gist
Apr 22, 2021 . 1 changed file with 11 additions and 10 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,10 @@ fn main() { app::set_visible_focus(false); let mut win = window::Window::default().with_size(400, 300); win.set_color(enums::Color::White); let mut but = button::Button::default() .with_size(80, 40) .with_label("Expand!") .center_of_parent(); but.set_color(enums::Color::Cyan); but.set_frame(enums::FrameType::RFlatBox); win.end(); @@ -15,16 +18,14 @@ fn main() { return; } let mut b = b.clone(); std::thread::spawn(move || loop { if b.y() == 0 { break; } b.resize(b.x() - 1, b.y() - 1, b.w() + 2, b.h()); app::sleep(0.005); b.parent().unwrap().redraw(); }); }); app.run().unwrap(); } -
MoAlyousef created this gist
Apr 22, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ use fltk::{prelude::*, *}; fn main() { let app = app::App::default(); app::set_visible_focus(false); let mut win = window::Window::default().with_size(400, 300); win.set_color(enums::Color::White); let mut but = button::Button::default().with_size(80, 40).with_label("Expand!").center_of_parent(); but.set_color(enums::Color::Cyan); but.set_frame(enums::FrameType::RFlatBox); win.end(); win.show(); but.set_callback(|b| { if b.y() == 0 { return; } let mut b = b.clone(); std::thread::spawn(move || { loop { if b.y() == 0 { break; } b.resize(b.x() - 1, b.y() - 1, b.w() + 2, b.h()); app::sleep(0.005); b.parent().unwrap().redraw(); } }); }); app.run().unwrap(); }