/* * hello.cpp * dim sep 22 16:55:19 EDT 2002 * * ---------------------------------------------------------------------- * * display a simple window with a title "hello" * * ---------------------------------------------------------------------- * * Compile with g++ `gtkfc-config --cflags` hello.cpp -o hello `gtkfc-config --libs` */ #define APPNAME "Hello World" #include <gtkfc.h> #include <Gapplication.h> class MyWindow : public Gwindow { public: MyWindow(Gstring s):Gwindow(s) { // imperatively set the main layout of the window SetLayout(new GboxLayout(Gcontainers::VERTICAL)); } ~MyWindow() { Gapplication::Exit(); } bool OnInit() { return true; } protected: bool OnDestroy(){ return true; } }; int main(int argc, char **argv) { Gapplication app(APPNAME, argc, argv); Gwindow *w = new MyWindow(app.GetAppName()); app.Add(w); w->Show(); app.Run(); return EXIT_SUCCESS; }