MCPcopy Create free account
hub / github.com/StereoKit/StereoKit / platform_msgbox_err

Function platform_msgbox_err

StereoKitC/platforms/uwp.cpp:720–745  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

718
719bool in_messagebox = false;
720void 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///////////////////////////////////////////

Callers

nothing calls this directly

Calls 2

platform_to_wcharFunction · 0.85
platform_sleepFunction · 0.70

Tested by

no test coverage detected