xtd 0.2.0
Loading...
Searching...
No Matches
use_wait_cursor.cpp

Shows how to create an use_wait_cursor with xtd::forms::application class.

Windows

macOS

Gnome

#include <xtd/xtd>
class form1 : public form {
public:
form1() {
text("Use wait cursor example");
button1.auto_size(true);
button1.location({10, 10});
button1.parent(*this);
button1.text("Do something...");
button1.click += delegate_ {
use_wait_cursor wait;
for (auto count = 0; count < 500; ++count) {
application::do_events();
thread::sleep(10_ms); // Simulate work...
}
};
}
private:
button button1;
};
auto main() -> int {
application::run(form1 {});
}
#define delegate_
The declaration of a delegate type is similar to a method signature. It has a return value and any nu...
Definition delegate.hpp:900