// STEP 1
// Creation of a manager, a view, and a graphic object
#include <ilviews/manager/manager.h>
#include <ilviews/graphics/rectangl.h>
static void Quit(IlvView* view, IlvAny)
{
delete view->getDisplay();;
IlvExit(0);
}
int main(int argc, char** argv)
{
// Creation of the Display
IlvDisplay* display = new IlvDisplay("EvalKitStep1");
// Creation of the Manager
IlvManager* manager = new IlvManager(display);
// Creation of the first view
IlvView* view = new IlvView(display, "View1", "Main View
- Step 1", IlvRect(0,0,300,200));
// Attach the view to the manager
manager->addView(view);
// Creation of a graphic object (a filled rectangle)
IlvFilledRectangle* rectangle = new IlvFilledRectangle(display,
IlvRect(20,20,40,30));
// Add this object in the manager
manager->addObject(rectangle);
// Add an exit callback so that the exit button is valid
view->setDestroyCallback(Quit);
// Run the event loop
IlvMainLoop();
return 0;
} |