Foundation classes for a basic GUI implementing simple widgets and events

Dependents:   TouchScreenGUIDemo

Core/GUI.cpp

Committer:
duncanFrance
Date:
2016-05-28
Revision:
18:d849f3ada858
Parent:
16:e9a771ecfdbe

File content as of revision 18:d849f3ada858:

#include "GUI.h"

GUI::GUI(GraphicsContext* context) : _context(context), _rootWindow(context)
{
    _context->eventDispatcher()->attachListener(&_rootWindow);
}

GraphicsContext* GUI::getGraphicsContext() {
    return _context;
}

Window* GUI::rootWindow() {
    return &_rootWindow;
}

void GUI::run() {
    _context->eventDispatcher()->pumpEvents();
    _rootWindow.draw();   
    
}