-
To send gio::Notification, I need the Application instance of the app. How can I send a notification in Example: let notif = Notification::new("Notification from my app");
THE_APP_HERE.send_notification(Some("notification-id-here"), ¬if); // How to do this? |
Beta Was this translation helpful? Give feedback.
Answered by
eminfedar
Sep 11, 2023
Replies: 1 comment
-
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"), ¬if);
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
eminfedar
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ah that was an easy one I missed. Just use the "root" gtk::Window parameter of the update function: