-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathBusyCursor.cpp
More file actions
29 lines (25 loc) · 785 Bytes
/
BusyCursor.cpp
File metadata and controls
29 lines (25 loc) · 785 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <wx/app.h>
#include <wx/button.h>
#include <wx/frame.h>
#include <wx/panel.h>
namespace BusyCursorExample {
class Frame : public wxFrame {
public:
Frame() : wxFrame {nullptr, wxID_ANY, "BusyCursor example"} {
button->Bind(wxEVT_BUTTON, [](wxCommandEvent& event) {
auto busyCursor = wxBusyCursor {};
for (auto count = 0; count < 500; ++count) {
wxMilliSleep(10); // Simulate work...
wxYield();
}
});
}
private:
wxPanel* panel = new wxPanel {this};
wxButton* button = new wxButton {panel, wxID_ANY, "Do something...", {10, 10}};
};
class Application : public wxApp {
auto OnInit() -> bool override {return (new Frame)->Show();}
};
}
wxIMPLEMENT_APP(BusyCursorExample::Application);