UPLOAD - DOSUIT07.ZIP - EXAMPLE1.CPP

 
Output of file : EXAMPLE1.CPP contained in archive : DOSUIT07.ZIP

// The classic "Hello world" application

#include
#include
#include
// The includes for the various toolkit components
#include "applic.hpp" /* The application */
#include "dialog.hpp" /* We will print in a dialog */
#include "cluster.hpp" /* To organise the dialog elements */
#include "button.hpp" /* The "Exit" button */
#include "text.hpp" /* To contain "Hello world" */
#include "event.hpp" /* To make the event queue */

// Every application that uses the toolkit must have one (and only one)
// statically declared EventQueue and Application.
EventQueue eventQueue;
Application example;

main()
{
// Create a Dialog. Note that all VObjects must be created with new
Dialog *main = new Dialog(
// Lay out the contents in a vertical cluster
new VCluster(ObjectCollection(2)
// The contents - a Text to contain the vital message
+ new Text("Hello world")
// and a CloseButton to let the user exit
+ new CloseButton
),
// The title of the Dialog
"example1");
// Place the dialog in the Application
main->show();
// All set up, call the main event loop
example.enter();
return 0;
}