text: #define MODULE_NAME  "HelloForm"
  
  #include "ecere.hpp"
  
  class HelloForm : public Window
  {
  public:
     Button button;
  
     CONSTRUCT(HelloForm, Window)
     {
        caption = $("Sample App using Ecere Toolkit/C++ Bindings");
        borderStyle = BorderStyle_sizable;
        clientSize = { 640, 480 };
        hasClose = true;
        hasMaximize = true;
        hasMinimize = true;
        background = SystemColor_formColor;
        font = { "Arial", 30 };
  
        button.parent = this;
        button.position = { 200, 200 };
        button.caption = $("Yay!!");
        button.notifyClicked = [](Window & owner, Button & btn, int x, int y, Modifiers mods)
        {
           HelloForm & self = (HelloForm &)owner;
           MessageBox msgBox;
           msgBox.caption = self.button.caption;
           msgBox.contents = $("C++ Bindings!");
           msgBox.modal();
           return true;
        };
     }
  
     REGISTER()
     {
        Window::class_registration(_class);
  
        register_onRedraw(_class, [](Window & w, Surface & surface) { surface.writeTextf(100, 100, $("Class Method!")); });
  
        DESTRUCT(HelloForm) = [](HelloForm & self) { printf("It's the end my friend!\n"); };
     }
  };
  
  GuiApplication app;
  
  REGISTER_CLASS_DEF(HelloForm, Window, app);
  
  HelloForm hello;
  
  MAIN_DEFINITION;
  