xtd 0.2.0
application_idle.cpp

demonstrates the use of idle event.

Windows

macOS

Gnome

#include <xtd/forms/application>
#include <xtd/forms/form>
using namespace xtd;
using namespace xtd::forms;
namespace application_idle_example {
class form1 : public form {
public:
form1() {
application::idle += {*this, &form1::on_application_idle};
}
private:
void on_application_idle(const event_args& e) {
text(string::format("{}", ++counter));
}
int counter = 0;
};
}
auto main() -> int {
application::run(application_idle_example::form1 {});
}
Represents the base class for classes that contain event data, and provides a value to use for events...
Definition event_args.hpp:18
static void run()
Begins running a standard application message loop on the current thread, without a form.
static event< application, delegate< void(const event_args &)> > idle
Occurs when the application finishes processing and is about to enter the idle state.
Definition application.hpp:330
Represents a window or dialog box that makes up an application's user interface.
Definition form.hpp:54
@ e
The E key.
Definition console_key.hpp:96
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition texts.hpp:217
Contains classes that represent ASCII and Unicode character encodings; abstract base classes for conv...
Definition basic_string_builder.hpp:16
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8