#include #include #include "glfont.h" #include "glwidgets.h" #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifndef _ #define _(x) x #endif mogltk::widget * mogltk::widget::cur_root = 0; mogltk::widget::widget(widget * _father, int _x, int _y, int _sx, int _sy) throw (GeneralException) : x(_x), y(_y), sx(_sx), sy(_sy), father(_father) { if (!father) father = cur_root; if (father) { next = father->child; father->child = this; root = father->root; } else { next = 0; cur_root = root = this; } prev = 0; child = 0; } mogltk::widget::~widget() { while(child) delete child; if (prev) prev->next = next; else if (father) father->child = next; if (next) next->prev = prev; }