mwcxx/test.cxx

37 lines
680 B
C++
Raw Normal View History

2026-04-17 19:42:14 +09:00
#include <MwCXX/Core.h>
#include <MwCXX/Widget/Window.h>
#include <MwCXX/Widget/Button.h>
#include <iostream>
class MyButton : public MwCXX::Button {
protected:
void OnActivate() {
std::cout << "Hello" << std::endl;
}
public:
MWCXX_CONSTRUCTOR(MyButton, MwCXX::Button) {
this->SetText("Hello, world!");
}
};
class MyWindow : public MwCXX::Window {
private:
MyButton* epic;
public:
MWCXX_CONSTRUCTOR(MyWindow, MwCXX::Window) {
this->epic = new MyButton("epic app", this, 10, 10, 640 - 10 * 2, 480 - 10 * 2);
}
};
int main() {
MyWindow* wnd;
MwCXX::Init();
wnd = new MyWindow("epic app", NULL, MwDEFAULT, MwDEFAULT, 640, 480);
wnd->Loop();
}