Skip to content

Amazing, mac notification popup window auto-hidden #291

Open

Description

@goldli

rust 1.98.0
rustover 2026.2.2
mac os 12.7.6

Cargo.toml

[package]
name = "test_notify"
version = "0.1.0"
edition = "2024"

[dependencies]
notify-rust = "4.18.0"

main.rs

use notify_rust::{ Notification, Timeout};

fn test_notify_rust_with_callback2() {
    Notification::new()
        .summary("click me>>")
        .body("This action>> needs to be clicked")
        .action("default>>>", "default") // IDENTIFIER, LABEL
        .action("clicked_a", "button a") // IDENTIFIER, LABEL
        .action("clicked_b", "button b") // IDENTIFIER, LABEL
        // .timeout(Timeout::Never) // works on kde and gnome
        .show()
        .unwrap()
        .wait_for_action(|action| match action {
            "default" => {
                println!("click default");
            },
            "clicked_a" => {
                println!("click clicked_a");
            },
            "clicked_b" => {
                println!("click clicked_b");
            },
            "__closed" => {
                println!("click __closed");
            },
            _ => (),
        });
}

see the video
screen video

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions