Mercurial > dwindows
view dwtestoo.cpp @ 2867:ada74f4d3f39
C++: Implement conditional signal handlers based on overrides.
This uses templates in a sort of hacky way to determine if our virtual
functions have been overridden. Leaving some debug code in for the moment
to make sure it works on all platforms. OS/2 will require using GCC for the
C++ bindings, since VisualAge only supports C++99 and Watcom doesn't even
support that as far as I know.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Sat, 17 Dec 2022 21:39:00 +0000 |
parents | 6ea67d0809eb |
children | 5ee1aaa48fc7 |
line wrap: on
line source
#include <dw.hpp> class MyWindow : public DW::Window<MyWindow> { public: MyWindow() { SetText("Basic application"); SetSize(200, 200); } virtual int OnDelete() override { DW::App *app = DW::App::Init(); app->MainQuit(); return FALSE; } virtual int OnConfigure(int width, int height) override { return FALSE; } }; int dwmain(int argc, char* argv[]) { DW::App *app = DW::App::Init(argc, argv, "org.dbsoft.dwindows.dwtestoo"); MyWindow *window = new MyWindow(); window->Show(); app->Main(); app->Exit(0); return 0; }