Compile a file

alza <[email protected]> Tue, 19 Oct 2004 22:49:17 +0100
Newsgroups gmane.comp.graphics.y.devel
Message-ID <[email protected]>
Hi all,

I'm new to Y windows and have just downloaded and ran it. I am tinkering 
about with the widgets. I copied the following code from Mark Thomas's 
paper. Unfortunately. there is no mention of how to compile it. Although 
I would say I'm fairly experienced at write code,  i am a new to 
prorgramming on Linux. Sorry for sounding like a complete smeg but can 
somebody be as kind to help.

Thanks

Alan



#include <stdlib.h>
#include <Y/c++.h>

static void
closeApplication()
{
   exit (EXIT_SUCCESS);
}

int
main (int argc, char **argv)
{
  Y::Y::initialise (&argc, &argv);
 
  Y::Window *window = new Y::Window ();
  window-> setProperty ("title", "Test Program");
 
  window-> requestClose.connect (SigC::slot (&closeApplication));
 
  window-> show();
 
  Y::Y::run();
  return EXIT_SUCCESS;
}