From 267c6f2ac71f92999e969232431ba04678e7437e Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 07:54:39 +0200 Subject: Adding upstream version 4:24.2.0. Signed-off-by: Daniel Baumann --- external/onlineupdate/workben/test_dialog.cxx | 39 +++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 external/onlineupdate/workben/test_dialog.cxx (limited to 'external/onlineupdate/workben') diff --git a/external/onlineupdate/workben/test_dialog.cxx b/external/onlineupdate/workben/test_dialog.cxx new file mode 100644 index 0000000000..4c956410d8 --- /dev/null +++ b/external/onlineupdate/workben/test_dialog.cxx @@ -0,0 +1,39 @@ +#include "progressui.h" + +#if defined(_WIN32) +#include "progressui_win.cpp" +#else +#include "progressui_gtk.cpp" +#endif + +#include +#include +#include + +void func() +{ + for (int i = 0; i <= 100; ++i) + { + std::this_thread::sleep_for(std::chrono::milliseconds(200)); + UpdateProgressUI(i); + } + QuitProgressUI(); +} + +int NS_main(int argc, NS_tchar** argv) +{ + InitProgressUI(&argc, &argv); + std::thread a(func); + /* + volatile bool b = false; + do + { + std::this_thread::sleep_for(std::chrono::seconds(1)); + } + while (!b); + */ + int result = ShowProgressUI(); + std::cout << result << std::endl; + a.join(); + return 0; +} -- cgit v1.2.3