Skip to content

How to send a notification? #530

Answered by eminfedar
eminfedar asked this question in Q&A
Discussion options

You must be logged in to vote

Ah that was an easy one I missed. Just use the "root" gtk::Window parameter of the update function:

    fn update(
        &mut self,
        msg: Self::Input,
        sender: ComponentSender<Self>,
        root: &Self::Root, // Use This window to access it's Application instance
    ) {
//...
        let app = root.application().unwrap(); // like this!

        app.send_notification(Some("notif-id"), &notif);
    }

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by eminfedar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant