Posted to tcl by emiliano at Fri Mar 04 12:11:59 GMT 2022view raw

  1. /* https://core.tcl-lang.org/tk/file?ci=tip&name=unix/tkUnixSysNotify.c&ln=135-143 */
  2.  
  3. enc = Tcl_GetEncoding(NULL, "utf-8");
  4. /*
  5. Tcl_ExternalToUtfDString(enc, title, -1, &dst);
  6. Tcl_ExternalToUtfDString(enc, message, -1, &dsm);
  7. */
  8. Tcl_UtfToExternalDString(enc, title, -1, &dst);
  9. Tcl_UtfToExternalDString(enc, message, -1, &dsm);
  10. notify_init("Wish");
  11. /*
  12. notif = notify_notification_new(title, message, icon, NULL);
  13. */
  14. notif = notify_notification_new(Tcl_DStringValue(&dst), Tcl_DStringValue(&dsm), icon, NULL);
  15. notify_notification_show(notif, NULL);
  16. Tcl_DStringFree(&dsm);
  17. Tcl_DStringFree(&dst);
  18. Tcl_FreeEncoding(enc);