| 718 | |
| 719 | bool in_messagebox = false; |
| 720 | void platform_msgbox_err(const char *text, const char *header) { |
| 721 | wchar_t* text_w = platform_to_wchar(text); |
| 722 | wchar_t* header_w = platform_to_wchar(header); |
| 723 | in_messagebox = true; |
| 724 | winrt::Windows::ApplicationModel::Core::CoreApplication::MainView().CoreWindow().Dispatcher().RunAsync( |
| 725 | winrt::Windows::UI::Core::CoreDispatcherPriority::Normal, [text_w, header_w]() { |
| 726 | |
| 727 | winrt::Windows::UI::Popups::MessageDialog dialog = winrt::Windows::UI::Popups::MessageDialog(text_w, header_w); |
| 728 | winrt::Windows::UI::Popups::UICommand command = winrt::Windows::UI::Popups::UICommand{ |
| 729 | L"OK", |
| 730 | winrt::Windows::UI::Popups::UICommandInvokedHandler{ |
| 731 | [](winrt::Windows::UI::Popups::IUICommand const &) { |
| 732 | in_messagebox = false; |
| 733 | return; |
| 734 | } |
| 735 | } |
| 736 | }; |
| 737 | dialog.Commands().Append(command); |
| 738 | dialog.ShowAsync(); |
| 739 | }); |
| 740 | while (in_messagebox) { |
| 741 | platform_sleep(100); |
| 742 | } |
| 743 | sk_free(text_w); |
| 744 | sk_free(header_w); |
| 745 | } |
| 746 | |
| 747 | |
| 748 | /////////////////////////////////////////// |
nothing calls this directly
no test coverage detected