GtkFC API Reference version 0.1.0

Main Page   Class Hierarchy   Alphabetical List   Compound List   Compound Members   Examples  

hello.cpp

/* 
 * 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;
}


Copyright © 2002 Thibaut Nicolas
Last modified  lun sep 23 23:41:26 EDT 2002