xtd 0.2.0
Loading...
Searching...
No Matches

◆ idle

event<application, delegate<void(const event_args&)> > xtd::forms::application::idle
static

Occurs when the application finishes processing and is about to enter the idle state.

Remarks
If you have tasks that you must perform before the thread becomes idle, attach them to this event.
For more information about handling events, see Handling and Raising Events.
Examples
The following code example demonstrates the use of application idle event.
#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.h:18
static void run()
Begins running a standard application message loop on the current thread, without a form.
Represents a window or dialog box that makes up an application's user interface.
Definition form.h:54
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition xtd_about_box.h:12
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10