I am unsure how to reproduce this without xwidgets.
Minimal example (Can be tried here).
- Change value to
0, 1, 2, 3, everything going as planned;
- Set value to
33, an exception message is shown;
- Change value to
0, the exception message is not cleared.
- Change value to
1, the message for 0 is cleared, the exception message is not cleared.
#include <iostream>
#include <stdexcept>
#include <xwidgets/xall.hpp>
#include <xcpp/xdisplay.hpp>
auto num = xw::number<std::uint32_t>();
auto out = xw::output();
XOBSERVE(num, value, [&](const auto& s) {
auto g = out.guard();
xcpp::clear_output();
if(s.value() == 33){
throw std::runtime_error("Exception");
}
std::cout << "Value: " << s.value() << std::endl;
});
xcpp::display(num);
xcpp::display(out);
I am unsure how to reproduce this without
xwidgets.Minimal example (Can be tried here).
0,1,2,3, everything going as planned;33, an exception message is shown;0, the exception message is not cleared.1, the message for0is cleared, the exception message is not cleared.