You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/toast_notify.rs
+5-4Lines changed: 5 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,7 @@
3
3
// Use the following command to run this example:
4
4
// > cargo run --example toast_notify --features "windows-data windows-ui"
5
5
6
+
#[macro_use]
6
7
externcrate winrt;
7
8
8
9
use winrt::*;
@@ -20,10 +21,10 @@ fn run() { unsafe {
20
21
let toast_xml = ToastNotificationManager::get_template_content(ToastTemplateType_ToastText02).unwrap();
21
22
22
23
// Fill in the text elements
23
-
let toast_text_elements = toast_xml.get_elements_by_tag_name(&FastHString::new("text")).unwrap();
24
+
let toast_text_elements = toast_xml.get_elements_by_tag_name(&*hstr!("text")).unwrap();
24
25
25
-
toast_text_elements.item(0).unwrap().append_child(&*toast_xml.create_text_node(&FastHString::new("Hello from Rust!")).unwrap().query_interface::<IXmlNode>().unwrap()).unwrap();
26
-
toast_text_elements.item(1).unwrap().append_child(&*toast_xml.create_text_node(&FastHString::new("This is some more text.")).unwrap().query_interface::<IXmlNode>().unwrap()).unwrap();
26
+
toast_text_elements.item(0).unwrap().append_child(&*toast_xml.create_text_node(&*hstr!("Hello from Rust!")).unwrap().query_interface::<IXmlNode>().unwrap()).unwrap();
27
+
toast_text_elements.item(1).unwrap().append_child(&*toast_xml.create_text_node(&*hstr!("This is some more text.")).unwrap().query_interface::<IXmlNode>().unwrap()).unwrap();
27
28
28
29
// could use the following to get the XML code for the notification
0 commit comments