[Rust] 09 FLTK-RS : 色設定, ツールチップ

[M1 Mac, Big Sur 11.6.7, Rust 1.62.0]

ランチャーアプリに色をつけて、さらにTooltipが表示されるようにしました。色設定にはenums::Colorを使います。

use fltk::{app, prelude::*, enums::*, button::*, window::Window, group::{Group}};

fn main() {
    let app = app::App::default();
    let mut window = Window::new(100, 100, 360, 190, "Tool Launcher");
    window.set_color(Color::from_u32(0x00A381));
    
    let  grp = Group::new(15, 15, 285 , 160, "");
    let mut _btn1= RadioRoundButton::new(15, 15, 140, 20, "OutingCosts");
    _btn1.set(true);
    _btn1.set_tooltip("OutingCosts.outingcosts");
    _btn1.set_label_color(Color::from_u32(0xFFFFFF));
    let mut _btn2= RadioRoundButton::new(15, 50, 140, 20, "PhotoSorting");
    _btn2.set_label_color(Color::from_u32(0xFFFFFF));
    let mut _btn3= RadioRoundButton::new(15, 85, 140, 20, "Scraping");
    _btn3.set_label_color(Color::from_u32(0xFFFFFF));
    let mut _btn4= RadioRoundButton::new(15, 120, 140, 20, "ScrapingJP");
    _btn4.set_label_color(Color::from_u32(0xFFFFFF));
    let mut _btn5= RadioRoundButton::new(15, 155, 140, 20, "");
    let mut _btn6= RadioRoundButton::new(160, 15, 140, 20, "");
    let mut _btn7= RadioRoundButton::new(160, 50, 140, 20, "");
    let mut _btn8= RadioRoundButton::new(160, 85, 140, 20, "");
    let mut _btn9= RadioRoundButton::new(160, 120, 140, 20, "");
    let mut _btn10= RadioRoundButton::new(160, 155, 140, 20, "");
    grp.end();

    let mut _btn = Button::new(300, 15, 50, 25, "実行");
    _btn.set_color(Color::from_u32(0x4D5AAF));
    _btn.set_label_color(Color::from_u32(0xFFFFFF));
    _btn.set_callback(move |_| {
        let _onoff1 = _btn1.value();let _onoff2 = _btn2.value();let _onoff3 = _btn3.value();
        let _onoff4 = _btn4.value();let _onoff5 = _btn5.value();let _onoff6 = _btn6.value();
        let _onoff7 = _btn7.value();let _onoff8 = _btn8.value();let _onoff9 = _btn9.value();
        let _onoff10 = _btn10.value();

        if _onoff1 == true{
            pythonmodule1();
        } else if _onoff2 == true{
            pythonmodule2();
        } else if _onoff3 == true{
            pythonmodule3();
        } else if _onoff4 == true{
            pythonmodule4();
        }
    });

    window.end();
    window.show();
    app.run().unwrap();
}