CFUserNotificationDisplayAlert添加到文本的网站链接

时间:2014-08-13 22:16:25

标签: macos core-foundation

我的项目中有一个CFUserNotificationDisplayAlert,只显示断言的文本。

我想在我的窗口中创建一些文本链接到一个网站,其中包含有关如何解决该问题的信息。

是否可以将我的fullText var中的一些文本标记为超链接?

我已经使用了您可以为其他功能创建的所有3个按钮,因此我无法使用其中一个链接到我的网站页面。

如果任何人对如何链接到可以欣赏的页面有任何其他想法。

我的代码如下:

// Show the window!

  CFOptionFlags responseFlags;
  CFStringRef strTitle = CFStringCreateWithCString(NULL, "Assert Failed", kCFStringEncodingUTF8);
  CFStringRef strBody = CFStringCreateWithCString(NULL, fullText, kCFStringEncodingUTF8);
  CFStringRef strBreak = CFStringCreateWithCString(NULL, "Break", kCFStringEncodingUTF8);
  CFStringRef strIgnore = CFStringCreateWithCString(NULL, "Ignore", kCFStringEncodingUTF8);
  CFStringRef strIgnoreAll = CFStringCreateWithCString(NULL, "Ignore All", kCFStringEncodingUTF8);

  CFUserNotificationDisplayAlert (
                                 0.0f,
                                 kCFUserNotificationCautionAlertLevel,
                                 NULL, // iconURL,
                                 NULL, // soundURL,
                                 NULL, // localizationURL,
                                 strTitle,
                                 strBody,
                                 strBreak, // defaultButtonTitle,
                                 strIgnoreAll, // alternateButtonTitle,
                                 strIgnore, // otherButtonTitle,
                                 &responseFlags
                                 );

0 个答案:

没有答案