summaryrefslogtreecommitdiffstats
path: root/WindowManager.cpp
blob: 971a1df8c0740ebc80f8da8cabf5c9eb45966ebd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "WindowManager.h"


WindowManager::WindowManager(GdkGLConfig *glconfig) {
  this->glconfig = glconfig;
  
  windows.push_back(new Window(glconfig, this));
}

WindowManager::~WindowManager() {
  for(std::list<Window*>::iterator w = windows.begin(); w != windows.end(); w++)
    delete *w;
}

void WindowManager::run() {
  for(std::list<Window*>::iterator w = windows.begin(); w != windows.end(); w++)
    (*w)->show();
  
  gtk_main();
}

void WindowManager::windowClosed(Window *window) {
  windows.remove(window);
  delete window;
  
  if(windows.empty())
    gtk_main_quit();
}