-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.cpp
More file actions
27 lines (21 loc) · 735 Bytes
/
main.cpp
File metadata and controls
27 lines (21 loc) · 735 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
#define OPENVCL_APP
#include "OpenVCL.h"
int __stdcall WinMain (HINSTANCE,HINSTANCE,LPSTR,int) {
// Create a Window
TWindow window("Demo Window", 300, 300);
// Create a Button for example
// 'window' is its owner, position is x:10 y:25 and the button-label is 'Test'
TButton button(&window, 10, 25, "Test");
// OnClick Handler
// Can take a function pointer or lambda
// example: Create a new window containing a label with text 'Ooh a Label!'
button.OnClick = [](TControl* s) {
s->GetWindow()->MsgBox("Hey", "What's Up?");
};
// Add 'button' to the controls-list of the window
window.controls.append(&button);
// initialize and run the window.
Application::Initialize();
Application::Run(&window);
return 0;
}