This repository has been archived on 2024-12-16. You can view files and clone it, but cannot push or open issues or pull requests.
CodeBlocksPortable/share/CodeBlocks/templates/SmartWin-main.cpp

31 lines
571 B
C++
Raw Normal View History

#include <SmartWin.h>
using namespace SmartWin;
class MyWidget
: public WidgetFactory<WidgetWindow, MyWidget>
{
public:
void clicked(WidgetButton * btn)
{
createMessageBox().show("Hello World Was Here");
}
void init()
{
createWindow();
setText("Hello World");
WidgetButton * btn = createButton();
btn->setText("My Button");
btn->setBounds(100, 100, 100, 100);
setBounds(100, 100, 400, 400);
btn->onClicked(&MyWidget::clicked);
}
};
int SmartWinMain(Application & app)
{
MyWidget * widget = new MyWidget();
widget->init();
return app.run();
}